express-is-googlecrawler
Advanced tools
Comparing version 1.0.3 to 1.0.4
10
index.js
@@ -7,7 +7,7 @@ const path = require('path') | ||
await loadIps() | ||
})() | ||
module.exports = (req, res, next) => { | ||
res.locals.isGoogleCrawler = isIpfromGoogle(req.ip) | ||
next() | ||
} | ||
})() | ||
module.exports = (req, res, next) => { | ||
res.locals.isGoogleCrawler = isIpfromGoogle(req.ip) | ||
next() | ||
} |
{ | ||
"name": "express-is-googlecrawler", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Express middleware that informs if request originates from a Google Bot or a Google Crawler", | ||
@@ -29,2 +29,3 @@ "main": "index.js", | ||
"expect.js": "^0.3.1", | ||
"express": "^4.19.2", | ||
"mocha": "^10.4.0", | ||
@@ -31,0 +32,0 @@ "standard": "^17.1.0" |
@@ -5,4 +5,14 @@ /* global describe, it, before */ | ||
const expect = require('expect.js') | ||
const express = require('express') | ||
const expressIsGoogleCrawler = require(path.join(__dirname, '..', 'index.js')) | ||
const { loadIps, isIpfromGoogle } = require(path.join(__dirname, '..', 'main.js')) | ||
describe('express', function () { | ||
it('Middleware is correctly passed', async () => { | ||
const app = express() | ||
app.use(expressIsGoogleCrawler) | ||
}) | ||
}) | ||
describe('Google bots/crawlers IPs', async function () { | ||
@@ -9,0 +19,0 @@ before(async () => { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6385
102
4
3