Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

express-spider-middleware

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-spider-middleware - npm Package Compare versions

Comparing version 1.1.6 to 1.1.7

29

index.js

@@ -29,9 +29,10 @@ const spiders = [

/DemandbasePublisherAnalyzer/i,
/yeti/i
]
/yeti/i,
/ias-va/i
];
function isSpider (ua) {
return spiders.some(function (spider) {
return spider.test(ua)
})
function isSpider(ua) {
return spiders.some(function(spider) {
return spider.test(ua);
});
}

@@ -42,11 +43,11 @@

middleware: function (callback) {
return function (req, res, next) {
req.isSpider = isSpider.bind(undefined, req.get('user-agent'))
if(isSpider(req.get('user-agent')) && typeof callback === 'function'){
callback(req)
middleware: function(callback) {
return function(req, res, next) {
req.isSpider = isSpider.bind(undefined, req.get("user-agent"));
if (isSpider(req.get("user-agent")) && typeof callback === "function") {
callback(req);
}
next()
}
next();
};
}
}
};
{
"name": "express-spider-middleware",
"version": "1.1.6",
"version": "1.1.7",
"description": "And ExpressJS middleware for detecting search engine crawlers/spiders and handling crawler-specific logic such as additional logging for requests from spiders",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc