Summary
The JS and native adapters currently construct materially different HttpRequest values for the same HTTP request.
Relevant code:
Confirmed differences
Query strings
With a registered GET /hello route:
- native:
GET /hello?x=1 returns 200, but the handler receives only /hello and cannot recover the query;
- JS:
GET /hello?x=1 returns 404 because routing uses the raw /hello?x=1.
PUT/PATCH bodies
An echo handler receives the request body on native. On JS, both PUT and PATCH have an empty raw_body because only POST subscribes to the Node data/end events.
Header casing
A handler using event.req.headers.get("X-Test") produced:
- JS:
missing whether the client sent x-test or X-Test (Node normalizes keys to lowercase);
- native: value found only when the wire casing was exactly
X-Test.
HTTP field names are case-insensitive, so application behavior must not depend on client casing or backend.
Expected behavior
Define one backend-independent request contract:
- route using a parsed path, while retaining the query separately;
- read framed bodies consistently for all applicable methods;
- use an owned, case-insensitive header abstraction;
- add the same request-conformance suite against JS and native adapters.
The exact public shape could be path + query, a parsed URI, or an explicit raw target, but handlers should receive equivalent information on both backends.
Summary
The JS and native adapters currently construct materially different
HttpRequestvalues for the same HTTP request.Relevant code:
req.urlMap[StringView, StringView]Confirmed differences
Query strings
With a registered
GET /helloroute:GET /hello?x=1returns 200, but the handler receives only/helloand cannot recover the query;GET /hello?x=1returns 404 because routing uses the raw/hello?x=1.PUT/PATCH bodies
An echo handler receives the request body on native. On JS, both PUT and PATCH have an empty
raw_bodybecause only POST subscribes to the Node data/end events.Header casing
A handler using
event.req.headers.get("X-Test")produced:missingwhether the client sentx-testorX-Test(Node normalizes keys to lowercase);X-Test.HTTP field names are case-insensitive, so application behavior must not depend on client casing or backend.
Expected behavior
Define one backend-independent request contract:
The exact public shape could be
path + query, a parsed URI, or an explicit raw target, but handlers should receive equivalent information on both backends.