Skip to content

[7/15] Engines: Content-Length on Netty, shared cross-engine HTTP conformance suite - #160

Open
UnknownJoe796 wants to merge 2 commits into
v53/security-headersfrom
v53/engine-conformance
Open

[7/15] Engines: Content-Length on Netty, shared cross-engine HTTP conformance suite#160
UnknownJoe796 wants to merge 2 commits into
v53/security-headersfrom
v53/engine-conformance

Conversation

@UnknownJoe796

Copy link
Copy Markdown
Contributor
  • Netty responses always set Content-Length; without it some clients hang
    waiting for more body.
  • Adds a cross-engine HTTP conformance suite in engine-local test fixtures,
    run by the Ktor, Netty and JDK engines, so behavioural drift between engines
    surfaces as a test failure rather than in production. It covers the Netty bug
    above.

@UnknownJoe796

Copy link
Copy Markdown
Contributor Author

Looks great.

@UnknownJoe796
UnknownJoe796 force-pushed the v53/settings-thread-safety branch from b2759a2 to ed1d009 Compare July 29, 2026 22:54
@UnknownJoe796
UnknownJoe796 force-pushed the v53/engine-conformance branch from ba49340 to af9221d Compare July 29, 2026 22:54
UnknownJoe796 and others added 2 commits July 29, 2026 17:21
toNettyResponse omitted Content-Length for bodyless responses (307
redirects, etc.). Without a Content-Length, a keep-alive HTTP/1.1 client
cannot tell the response is complete and stalls until the idle timeout
closes the connection. Always emit the length (0 when empty). Ktor and
JDK already did this; Netty was the outlier.

Surfaced by the new cross-engine conformance suite: the trailing-slash
307 redirect test took 120s on Netty (idle timeout) versus <1s on the
other engines.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
(cherry picked from commit 1f76395)
(cherry picked from commit b05e864)
The Ktor, Netty, and JDK engines each hand-roll request/response
translation with no shared test asserting they behave identically
against the expectations.md contract. Add one reusable suite in
engine-local test fixtures (EngineHttpConformanceSuite) that each engine
runs via a ~30-line subclass supplying only how to start itself; the
shared HTTP client is the JDK's java.net.http.HttpClient so no new test
deps are needed.

Checks (all pass on all three engines): nosniff on success and error
responses, HEAD fallback, trailing-slash 307 with Location, CORS origin
reflection, OPTIONS preflight, HSTS absent over http, timeout 408, and
oversized-body 413 (first 413 coverage for Netty).

Known gaps are asserted honestly rather than faked: expectations.md's
static OPTIONS headers (Allow/Accept-Post/Accept-Patch/Accept-Ranges)
and Range/Accept-Ranges are not implemented at the engine level and are
documented in the suite as unmet expectations, not passing assertions.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
(cherry picked from commit 0a4811b)
(cherry picked from commit af9221d)
@UnknownJoe796
UnknownJoe796 force-pushed the v53/settings-thread-safety branch from ed1d009 to 4067167 Compare July 30, 2026 02:19
@UnknownJoe796
UnknownJoe796 force-pushed the v53/engine-conformance branch from af9221d to d8cf104 Compare July 30, 2026 02:19
@UnknownJoe796
UnknownJoe796 changed the base branch from v53/settings-thread-safety to v53/security-headers July 30, 2026 02:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant