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
new Request(url, { headers: <Proxy over a record> }) silently produces empty headers; bun/node produce the header. A Headers built directly from the same proxy is correct (that path is fixed in the PR referenced below), so only the Request init path is affected.
bun 1.3.14: request ["x-a=1"] — perry: request [].
Silently dropping headers is worse than throwing: a request just goes out without its authorization or content-type header.
Notes
js_headers_init_from_value (perry-stdlib fetch/headers.rs) handles a proxied record correctly once the record path accepts proxies. The Request path does not end up there with the proxy value, so the conversion happens somewhere else (request_ctor.rs reads init.headers and calls that helper; codegen also has a compile-time build_headers_from_object for literal inits in lower_call/options/). Worth checking which of the two runs for a dynamic (non-literal) headers value.
Summary
new Request(url, { headers: <Proxy over a record> })silently produces empty headers; bun/node produce the header. AHeadersbuilt directly from the same proxy is correct (that path is fixed in the PR referenced below), so only the Request init path is affected.Repro
bun 1.3.14:
request ["x-a=1"]— perry:request [].Silently dropping headers is worse than throwing: a request just goes out without its authorization or content-type header.
Notes
js_headers_init_from_value(perry-stdlibfetch/headers.rs) handles a proxied record correctly once the record path accepts proxies. The Request path does not end up there with the proxy value, so the conversion happens somewhere else (request_ctor.rsreadsinit.headersand calls that helper; codegen also has a compile-timebuild_headers_from_objectfor literal inits inlower_call/options/). Worth checking which of the two runs for a dynamic (non-literal) headers value.