New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

simplecrawler

Package Overview
Dependencies
Maintainers
2
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simplecrawler - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

4

lib/crawler.js

@@ -309,3 +309,5 @@ // Simplecrawler

// They should be the same flipped around!
return subdomain.reverse().substr(0,host.length) === host.reverse();
return (
subdomain.split("").reverse().join("").substr(0,host.length) ===
host.split("").reverse().join(""));
}

@@ -312,0 +314,0 @@

{
"name": "simplecrawler",
"description": "Very straigntforward web crawler. Uses EventEmitter. Generates queue statistics and has a basic cache mechanism with extensible backend.",
"version": "0.1.1",
"version": "0.1.2",
"homepage": "http://github.com/cgiffard/node-simplecrawler",

@@ -6,0 +6,0 @@ "author": "Christopher Giffard <christopher.giffard@cgiffard.com>",

@@ -9,5 +9,30 @@ // Tests whether a given resource is considered 'valid' for crawling under

it("should be able to determine whether a domain is a subdomain of another",
function() {
var crawler = new (require("../"))("example.com",3000);
// Enable scanning subdomains, important for this test
crawler.scanSubdomains = true;
// The domain itself isn't a subdomain per-se, but should be allowed
crawler.domainValid("example.com").should.equal(true);
// WWW is a subdomain
crawler.domainValid("www.example.com").should.equal(true);
// More complex examples
crawler.domainValid("testing.example.com").should.equal(true);
// Multiple levels
crawler.domainValid("system.cache.example.com").should.equal(true);
// These aren't valid...
crawler.domainValid("com.example").should.equal(false);
crawler.domainValid("example.com.au").should.equal(false);
crawler.domainValid("example.us").should.equal(false);
});
});

@@ -14,0 +39,0 @@

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