Title: lab-ops-hub: container validator keeps the password colon when the password is empty (user:@ / :@) — returned URL differs from the Worker · Issue #651 · developing-today/code · GitHub
Open Graph Title: lab-ops-hub: container validator keeps the password colon when the password is empty (user:@ / :@) — returned URL differs from the Worker · Issue #651 · developing-today/code
X Title: lab-ops-hub: container validator keeps the password colon when the password is empty (user:@ / :@) — returned URL differs from the Worker · Issue #651 · developing-today/code
Description: Problem The container validator (pkgs/lab-ops-hub/container/app.py, validate_crawl_url) returns a URL whose userinfo keeps the password colon when the password is empty, while the Worker validator (pkgs/lab-ops-hub/src/lib.ts, WHATWG URL...
Open Graph Description: Problem The container validator (pkgs/lab-ops-hub/container/app.py, validate_crawl_url) returns a URL whose userinfo keeps the password colon when the password is empty, while the Worker validator ...
X Description: Problem The container validator (pkgs/lab-ops-hub/container/app.py, validate_crawl_url) returns a URL whose userinfo keeps the password colon when the password is empty, while the Worker validator ...
Opengraph URL: https://github.com/developing-today/code/issues/651
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"lab-ops-hub: container validator keeps the password colon when the password is empty (user:@ / :@) — returned URL differs from the Worker","articleBody":"## Problem\n\nThe container validator (`pkgs/lab-ops-hub/container/app.py`, `validate_crawl_url`) returns a URL whose userinfo keeps the password colon when the password is empty, while the Worker validator (`pkgs/lab-ops-hub/src/lib.ts`, WHATWG `URL`) serialises that colon away:\n\n| Input | Container returns | Worker returns |\n|---|---|---|\n| `http://user:@example.com/` | `http://user:@example.com/` | `http://user@example.com/` |\n| `http://:@example.com/` | `http://:@example.com/` | `http://example.com/` |\n| `http://:@example.com:80/` | `http://:@example.com/` | `http://example.com/` |\n\nVerified this run on main `93065f0d` by driving both real validators over a 357-URL differential matrix plus a focused 23-URL probe; these were the only userinfo divergences. Controls that already agree and must not change: `http://:pass@example.com/` (kept), `http://::@example.com/` -> `http://:%3A@example.com/` (the colon is password *data*), `http://user::@example.com/` -> `http://user:%3A@example.com/`, `http://user:pass@example.com/` (kept), and the bare empty userinfo `http://@example.com/` (already dropped, #639).\n\n## Root cause\n\nWHATWG serialises userinfo from the parsed username/password: the `:` separator is emitted only when the password is non-empty, and the whole `@` is dropped when both are empty. The container instead round-trips the raw userinfo string:\n\n- `_encode_userinfo` (app.py ~line 895) re-adds `\":\"` whenever a separator was present in the raw spelling (`if sep:`), regardless of whether the password is empty.\n- `_url_with_encoded_components` (app.py ~line 909) decides whether to keep the `@` on the *raw* userinfo's truthiness (`if userinfo`), so `\":\"` — a non-empty string with two empty components — survives as `:@` even once the encoded form is empty.\n- `_normalize_validated_url` has the same raw-truthiness shape, though the final encoded-components rebuild is what reaches the caller.\n\n#639 fixed exactly this class for the *empty userinfo* spelling (`@` with nothing before it) but missed the colon-bearing spellings, because `:` and `user:` are non-empty strings.\n\n## Why it matters\n\nThe URL `validate_crawl_url` returns is the URL that is recorded and fetched (the module's standing #633/#639 contract: both crawlers record — and fetch — the same URL for the same target). Fetch *behaviour* already agrees — `_split_userinfo` (app.py ~line 979) treats `:@` as carrying no credentials and `user:@` exactly as `user@` — so this is a returned-form divergence only: the same crawl target is recorded under two different URL strings depending on which crawler ran, defeating dedup/logging comparisons between the container and Worker paths.\n\n## Acceptance criteria\n\n- `validate_crawl_url(\"http://user:@example.com/\")` returns `http://user@example.com/` and `validate_crawl_url(\"http://:@example.com/\")` returns `http://example.com/`, matching the Worker byte for byte (including with a default/non-default port present).\n- The controls above are unchanged: `:pass@`, `::@` -> `:%3A@`, `user::@` -> `user:%3A@`, `user:pass@`, and bare `@`.\n- New cases in `pkgs/lab-ops-hub/test/test_container_validate.py` pin the returned form for the empty-password spellings (the existing tests assert acceptance only); Python suite and the TS suite (`test/lib.test.ts`) pass.\n- A differential run of both validators over userinfo spellings shows no remaining userinfo divergences.\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-10-23T06:15:54Z","url":"https://github.com/developing-today/code/issues/651"}
| 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:63242210-2bd1-939e-052c-c610d1ed02f7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AED0:7F906:AE475C:E11700:6B063941 |
| html-safe-nonce | 7a4237816e0dfb98ff86f213f975bb378378dcf8e6f137dae81d977835853994 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRUQwOjdGOTA2OkFFNDc1QzpFMTE3MDA6NkIwNjM5NDEiLCJ2aXNpdG9yX2lkIjoiNjQ4MTkxODYxMTQ1OTI5MTQ1NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 2e8aea316c101738d6e624b7cfefdd5aa1a2ae480e4fada59618d2726759b5ab |
| hovercard-subject-tag | issue:5992942481 |
| 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/651/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c99500d791fd71d4da78185a093bf4403f41e85f86a6aff1fc8ecd2240f4ac85/developing-today/code/issues/651 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c99500d791fd71d4da78185a093bf4403f41e85f86a6aff1fc8ecd2240f4ac85/developing-today/code/issues/651 |
| og:image:alt | Problem The container validator (pkgs/lab-ops-hub/container/app.py, validate_crawl_url) returns a URL whose userinfo keeps the password colon when the password is empty, while the Worker validator ... |
| 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 | dcf72c457c022486d23c3cbb0dd21aba537a87611ca9ddabd1799cf2eaa9b297 |
| 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 | 0f38f5735226749ec5e08a8649dce4cb2613d9ad |
| 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