Title: lab-ops-hub: container validator returns dot segments, host case and default ports un-normalized — fetcher requests a different path than the Worker · Issue #633 · developing-today/code · GitHub
Open Graph Title: lab-ops-hub: container validator returns dot segments, host case and default ports un-normalized — fetcher requests a different path than the Worker · Issue #633 · developing-today/code
X Title: lab-ops-hub: container validator returns dot segments, host case and default ports un-normalized — fetcher requests a different path than the Worker · Issue #633 · developing-today/code
Description: Finding The container validator returns the crawl target without the WHATWG normalizations the Worker validator applies, so for the same accepted target the two crawlers record — and fetch — different URLs: Dot segments are never resolve...
Open Graph Description: Finding The container validator returns the crawl target without the WHATWG normalizations the Worker validator applies, so for the same accepted target the two crawlers record — and fetch — differ...
X Description: Finding The container validator returns the crawl target without the WHATWG normalizations the Worker validator applies, so for the same accepted target the two crawlers record — and fetch — differ...
Opengraph URL: https://github.com/developing-today/code/issues/633
X: @github
Domain: github.com
IPv4 address: 140.82.112.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"lab-ops-hub: container validator returns dot segments, host case and default ports un-normalized — fetcher requests a different path than the Worker","articleBody":"## Finding\n\nThe container validator returns the crawl target without the WHATWG\nnormalizations the Worker validator applies, so for the same accepted\ntarget the two crawlers record — and fetch — different URLs:\n\n1. **Dot segments are never resolved.** Literal `.` / `..` segments and\n their percent-encoded spellings (`%2e`, `.%2e`, `%2e.`, `%2e%2e`, any\n case) are returned verbatim by the container and sent verbatim on the\n wire by its fetcher. The Worker resolves them per the WHATWG URL path\n rules before fetching.\n2. **Host case is preserved.** The Worker lowercases the host in the\n returned URL; the container returns `EXAMPLE.COM` as spelled.\n3. **Default ports are preserved**, including leading-zero spellings:\n the Worker drops `:80` / `:443` (and `:080` / `:0080`); the container\n returns them verbatim.\n\n`validate_crawl_url` (`pkgs/lab-ops-hub/container/app.py:77`, returns at\n:399 and :439) returns `_url_with_encoded_components(raw …)` — the raw\nspelling with only the character-encoding fixes of #614/#615/#618. No\nstep resolves path segments, lowercases the host, or drops a default\nport. The Worker validator (`pkgs/lab-ops-hub/src/lib.ts:130`) returns\n`u.toString()` (:182, :188), the fully WHATWG-normalized form.\n\n## Evidence\n\nVerified this run on main `00bb59d5` (lab-ops-hub at `07a16b76`),\ndriving both real validators (Python `validate_crawl_url`; Worker's\n`validateCrawlUrl` under Bun):\n\n| Input | Container returns | Worker returns |\n|---|---|---|\n| `http://example.com/a/../b` | `http://example.com/a/../b` | `http://example.com/b` |\n| `http://example.com/a/./b` | `http://example.com/a/./b` | `http://example.com/a/b` |\n| `http://example.com/%2e%2e/admin` | `http://example.com/%2e%2e/admin` | `http://example.com/admin` |\n| `http://example.com/a/%2e%2e/b` | `http://example.com/a/%2e%2e/b` | `http://example.com/b` |\n| `http://example.com/%2e/%2e/x` | `http://example.com/%2e/%2e/x` | `http://example.com/x` |\n| `http://example.com/a/%2E/b` | `http://example.com/a/%2E/b` | `http://example.com/a/b` |\n| `HTTP://EXAMPLE.COM/Path` | `http://EXAMPLE.COM/Path` | `http://example.com/Path` |\n| `http://example.com:80/x` | `http://example.com:80/x` | `http://example.com/x` |\n| `https://example.com:443/x` | `https://example.com:443/x` | `https://example.com/x` |\n| `http://example.com:080/x` | `http://example.com:080/x` | `http://example.com/x` |\n| `http://user:pass@EXAMPLE.com:80/` | `http://user:pass@EXAMPLE.com:80/` | `http://user:pass@example.com/` |\n\nFetcher consequence, reproduced with the app's own `_fetch_crawl`\n(`app.py:827`) against a local HTTP server (proxy env unset): for\n`http://127.0.0.1:\u003cport>/a/../b` the server receives the request target\n`/a/../b` verbatim, and for `/%2e%2e/admin` it receives `/%2e%2e/admin`\nverbatim. The Worker's WHATWG `fetch` requests `/b` and `/admin`. An\norigin (or any proxy/WAF in front of it) that routes on the raw request\ntarget therefore serves the container a different resource than the\nWorker for the same validated target, and `%2e%2e` spellings are the\nclassic path-confusion form when one layer resolves them and another\ndoes not. Redirect targets inherit the divergence: the container's\n`_ValidatingRedirectHandler` validates the raw `Location` value and\nfetches the container's returned form.\n\nVerdicts agree throughout (every spelling above is accepted by both\nvalidators, and blocked-host controls — `LOCALHOST`, `127.0.0.1:080` —\nare refused by both): this is a fetched-URL identity divergence, not an\naccept/refuse one. Minor opposite-direction note from the same battery:\nempty query/fragment markers — the Worker keeps a trailing `?` / `#`\n(`http://example.com/x?`), the container drops them; folding that into\nthe same normalization pass settles it either way.\n\nDedup: searches for \"dot segment\", \"default port\", \"lowercase host\"\nand \"%2e\" return no issue covering this; the closed #614/#615/#618\nseries covers character *encoding* on the returned URL only. The\nvalidator pair exists only in this repo (grep of the\nopencode/openchamber/nix clones is empty).\n\n## Why it matters\n\nThe container and the Worker fallback are supposed to crawl the same\ntarget; the last several fixes in this area (#577/#586/#611/#614/#615/\n#618) each aligned one piece of the returned URL so \"the URL the\nfetcher fetches\" is the URL the Worker fetches. Path identity is the\nremaining piece: today a target spelled with dot segments — including\nthe percent-encoded traversal spelling — is fetched as two different\npaths depending on which crawler serves it, so crawl results (status,\nbody, recorded URL) differ by crawler for reasons invisible to callers.\n\n## Acceptance criteria\n\n- `validate_crawl_url` returns the WHATWG-normalized form for the\n battery above: dot segments (literal and `%2e` spellings, any case,\n including a trailing dot segment's trailing-slash semantics) resolved,\n host lowercased, and the scheme's default port dropped (including\n leading-zero spellings); non-default ports, empty path segments\n (`//`), query and fragment are preserved as WHATWG preserves them.\n- A fetcher end-to-end test shows the container requesting the resolved\n path (`/b`, `/admin`) for dot-segment targets, matching the Worker.\n- A container-vs-Worker differential over the battery (plus the\n existing validator batteries) shows byte-identical returned URLs,\n with the existing Python and TS suites still passing.\n- Care with ordering: normalization must not double-decode\n percent-encodings the #529/#615/#618 steps produced (e.g. a literal\n `%252e` segment is data, not a dot segment).\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-10-23T02:00:54Z","url":"https://github.com/developing-today/code/issues/633"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:312ad6f2-07c7-35d5-a739-c82fc4b498fc |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C1E4:74E58:A6A2E0:DF72BB:6B064233 |
| html-safe-nonce | b56da7aeb08059135f0f8e2cec9680288e63073531cabe068be5e36221fca533 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMUU0Ojc0RTU4OkE2QTJFMDpERjcyQkI6NkIwNjQyMzMiLCJ2aXNpdG9yX2lkIjoiODk1MzA5MDIwMTk3OTYwMTQ1OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | bd3bc33bd8a7131281178b51d085d32e487661a8d5462b1fef11e1138a257737 |
| hovercard-subject-tag | issue:5990535465 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/developing-today/code/633/issue_layout |
| twitter:image | https://opengraph.githubassets.com/29b11b0421b48bb2fa13a80c1604ad100ff7177270e0c6a5b00d2b5338683fab/developing-today/code/issues/633 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/29b11b0421b48bb2fa13a80c1604ad100ff7177270e0c6a5b00d2b5338683fab/developing-today/code/issues/633 |
| og:image:alt | Finding The container validator returns the crawl target without the WHATWG normalizations the Worker validator applies, so for the same accepted target the two crawlers record — and fetch — differ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dezren39 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 1bff4f6bfaa96dc9c42cacf315424c24ebb548b06142ced5e3aaccb2a42dd652 |
| turbo-cache-control | no-preview |
| go-import | github.com/developing-today/code git https://github.com/developing-today/code.git |
| octolytics-dimension-user_id | 26439447 |
| octolytics-dimension-user_login | developing-today |
| octolytics-dimension-repository_id | 627308783 |
| octolytics-dimension-repository_nwo | developing-today/code |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 627308783 |
| octolytics-dimension-repository_network_root_nwo | developing-today/code |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ac613d3698d3d8565651455086e1f74da07bf277 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width