diff --git a/src/parser.js b/src/parser.js index a7c8f37..ab1b9cc 100644 --- a/src/parser.js +++ b/src/parser.js @@ -45,7 +45,7 @@ const parsePattern = (pattern) => { .replace(wildCardPattern, '.*') .replace(EOLPattern, '$'); - return new RegExp(regexString, flags); + return new RegExp(`^${regexString}`, flags); }; const groupMemberRecord = (value) => ( diff --git a/test/test-data/can-crawl-test-data.js b/test/test-data/can-crawl-test-data.js index 5f0f914..b6b964d 100644 --- a/test/test-data/can-crawl-test-data.js +++ b/test/test-data/can-crawl-test-data.js @@ -60,4 +60,13 @@ module.exports = [{ testPath: '/fish*.php', matches: ['/fish.php', '/fishheads/catfish.php?parameters'], nonMatch: ['/Fish.PHP'], +}, { + robots: ` + User-agent: * + Disallow: /rss + Allow: / + `, + testPath: '/rss', + matches: ['/home/rssa'], + nonMatch: ['/rss'], }];