GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||
GeezerVison is showing github.com — fix(lab-ops-hub): return WHATWG-normalized URLs from the container validator (#633) by dezren39 · Pull Request #644 · developing-today/code Conversation
|
| Input | Container returned | Worker returns |
|---|---|---|
http://example.com/a/../b |
http://example.com/a/../b |
http://example.com/b |
http://example.com/%2e%2e/admin |
verbatim | http://example.com/admin |
HTTP://EXAMPLE.COM/Path |
http://EXAMPLE.COM/Path |
http://example.com/Path |
http://example.com:80/x, :080 |
verbatim | http://example.com/x |
The fetcher consequence is the serious arm: _fetch_crawl sent /a/../b and /%2e%2e/admin on the wire verbatim, so an origin (or proxy/WAF) that routes on the raw request target serves the container a different resource than the Worker — and %2e%2e is the classic path-confusion spelling when one layer resolves it and another does not.
New _normalize_validated_url, applied at both validate_crawl_url return sites (DNS names and IP literals); redirect targets inherit it via _ValidatingRedirectHandler → validate_crawl_url.
_resolve_dot_segments: a segment is a single-dot segment iff it is . or %2e, a double-dot segment iff it is .., .%2e, %2e. or %2e%2e (any case). Single-dot drops, double-dot pops the previous segment, neither climbs above the root, and a trailing dot segment becomes an empty final segment (/a/. → /a/, /a/.. → /, //%2e → //). Empty segments are preserved (//a//b verbatim, /a//../b → /a/b), and longer/double-encoded spellings are data, never double-decoded (%2e%2e%2e, %252e%252e pass through). The path's ;params tail is rejoined before resolving, so a trailing ..;foo is data, not a double-dot segment.:080, :0443), any other port is stripped of leading zeros (:08080 → :8080), and an empty port's colon is dropped (that one arm of lab-ops-hub: container validator returns empty path, empty port and empty userinfo un-normalized — recorded URL differs from the Worker #639 rides along with port canonicalization; lab-ops-hub: container validator returns empty path, empty port and empty userinfo un-normalized — recorded URL differs from the Worker #639's empty-path and empty-userinfo arms remain open).No verdict changes: blocked hosts in these spellings are still refused by the ordinary checks, for the right reason (#633's controls verified).
9298c5f2 before the fix (all issue spellings returned verbatim)./b, /admin is what reaches the server), and a TS pin of the Worker form. Python 54/54, TS 37/37.app.py reverted, exactly the 3 new Python tests fail.münchen.de, the Worker serializes punycode).ruff format applied. Single-repo: no validate_crawl_url/validateCrawlUrl copy exists in the opencode/openchamber/nix clones (grep-verified), so no cross-repo port is owed.
Need help on this PR? Tag @codesmith-bot with what you need.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…lidator (#633) validate_crawl_url returned dot segments, host case and default ports verbatim, so the container recorded — and fetched — a different URL than the Worker for the same accepted target (/a/../b and /%2e%2e/admin went on the wire verbatim). Add _normalize_validated_url, applied at both return sites: _resolve_dot_segments resolves literal and %2e dot segments (any case, trailing dot segments become a trailing slash, no climbing above the root, empty segments and %252e data preserved), the host is ASCII-lowercased (IDN spelling kept, as before), and the port is canonicalized (scheme default dropped including leading-zero spellings, other ports stripped of leading zeros, empty port colon dropped). Redirect targets inherit the form via validate_crawl_url. Tests: Python battery + redirect-handler pin + fetcher end-to-end (resolved path reaches the server), TS pin of the Worker form. Differential vs the Worker validator under Bun: byte-identical returned URLs over the issue battery and a 1500-case fuzz over dot-segment/host-case/port spellings.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing: 3
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
lab-ops-hub: container validator returns dot segments, host case and default ports un-normalized — fetcher requests a different path than the Worker
There was an error while loading. Please reload this page.