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
lab-ops-hub: container validator resolves a trailing '..;' / '.;' segment as a dot segment — bare-semicolon params tail is lost, returned path differs from the Worker #655
The container validator (pkgs/lab-ops-hub/container/app.py) resolves a trailing dot segment followed by a bare semicolon (..;, .;, %2e;, %2e%2e;) as if it were a plain dot segment, and returns a different path than the Worker returns for the same target. WHATWG treats ..; as an ordinary path segment (the semicolon is data), so the Worker keeps it; the container drops the segment entirely (and, for ..;, pops the previous segment too), so the two crawlers record — and fetch — different URLs.
Evidence (verified on main 3ac2e9ee, driving the real Python validator vs Node's WHATWG URL)
Input
Container returns
Worker (WHATWG) returns
http://example.com/..;
http://example.com/
http://example.com/..;
http://example.com/.;
http://example.com/
http://example.com/.;
http://example.com/foo/..;
http://example.com/
http://example.com/foo/..;
http://example.com/a/.;
http://example.com/a/
http://example.com/a/.;
http://example.com/a/b/..;
http://example.com/a/
http://example.com/a/b/..;
http://example.com/%2e;
http://example.com/
http://example.com/%2e;
http://example.com/%2e%2e;
http://example.com/
http://example.com/%2e%2e;
http://example.com/..;?q
http://example.com/?q
http://example.com/..;?q
Controls that already agree (non-empty params are handled): http://example.com/..;foo, http://example.com/foo/.;x, http://example.com/a/..;foo all return unchanged in both.
Root cause
urlparse splits the last path segment at the first ; into path + params. For a bare trailing ; the params are the empty string:
_normalize_validated_url (app.py:849) rejoins only when params is truthy: full_path = u.path + (f";{u.params}" if u.params else "") — so the ; is lost exactly when params is empty, and _resolve_dot_segments then treats the rejoined /.. / /. / /%2e as a dot segment. The comment at app.py:816-820 documents the rejoin intent ("a trailing ..;foo is data, not a double-dot segment") but the empty-params arm defeats it. The existing tests at app.py:979-980 / the test suite cover only ..;foo spellings.
_url_with_encoded_components (app.py:~942) has the same loss independently: it rebuilds from u.path + u.params, so even a correctly normalized /..; would come back as /...
Why it matters
The URL validate_crawl_url returns is the URL the fetcher fetches. A target whose last segment is ..; / .; (a legitimate, if unusual, path spelling) is fetched by the container at the collapsed path — a different resource than the Worker fetches and than was judged — the same returned-form divergence class as #633/#639, in the one params arm those fixes missed.
Acceptance criteria
validate_crawl_url returns the WHATWG form for the table above (segments ..;, .;, %2e;, %2e%2e; preserved verbatim, including before ?/#).
The fix covers both rebuild sites (_normalize_validated_url and _url_with_encoded_components); one clean way is to take the full path (including the ;params tail) from urlsplit, which never splits params, instead of rejoining urlparse's split.
New regression tests in pkgs/lab-ops-hub/test/test_container_validate.py pin the bare-; spellings alongside the existing ..;foo controls; existing suite stays green.
No change to acceptance/refusal verdicts — returned form only.
Activity
style(lab-ops-hub): ruff-format the #655 rebuild sites (treefmt)
Merge pull request #656 from developing-today/creator/655-bare-semico…