You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Page type: isRootPath reads a backslash URL as the site root #903
isRootPath (packages/page-classifier/src/rules-fallback.ts) strips the scheme and looks for the first "/" in the string. An unnormalised URL that uses a backslash as the path separator, such as https://example.com\about, has no "/" after the host, so the function reads it as a root path and the homepage rule would label the page homepage with confidence 1.
Crawler URLs are normalised before they reach the classifier, so this does not show up in an audit today. The classifier is also a library entry point (classifyPage(html, url)), and its documentation says a non-root page never gets homepage (#900), a claim that assumes a normalised URL.
Acceptance Criteria
isRootPath("https://example.com\\about") is false.
isRootPath parses the URL with the platform URL parser (or an equivalent that treats a backslash like a slash for special schemes) and keeps the existing true cases: https://example.com, https://example.com/, https://example.com/?a=1, https://example.com/#top.
A URL that cannot be parsed returns false, not true.
Tests cover the backslash form, a userinfo form (https://[email protected]/a) and an unparseable string.
I would like to take this. I will switch isRootPath to the platform URL parser, preserve the documented root/query/fragment cases, return false on parse failures, and add focused regressions for backslash paths, userinfo, and malformed input.
I checked current main at 73c2efe before editing, but packages/page-classifier and rules-fallback.ts are not present, and repository code search finds no isRootPath symbol. I will not manufacture a replacement in a different classifier surface. If this issue targets another branch or a package that is about to land, please point me to that base and I can revisit it.
The page-classifier package and isRootPath are now on main, so I am resuming this previously claimed issue. I will keep the fix limited to URL parsing plus the acceptance-test cases, then open a focused PR.
Activity
WilliamK112 commentedon Oct 21, 2026
I would like to take this. I will switch
isRootPathto the platform URL parser, preserve the documented root/query/fragment cases, return false on parse failures, and add focused regressions for backslash paths, userinfo, and malformed input.WilliamK112 commentedon Oct 21, 2026
I checked current
mainat73c2efebefore editing, butpackages/page-classifierandrules-fallback.tsare not present, and repository code search finds noisRootPathsymbol. I will not manufacture a replacement in a different classifier surface. If this issue targets another branch or a package that is about to land, please point me to that base and I can revisit it.WilliamK112 commentedon Oct 27, 2026
The page-classifier package and
isRootPathare now onmain, so I am resuming this previously claimed issue. I will keep the fix limited to URL parsing plus the acceptance-test cases, then open a focused PR.fix(classifier): parse homepage URLs safely squirrelscan#903
fix(classifier): parse homepage URLs safely, backslash paths are not …