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 }}
This repository was archived by the owner on May 3, 2024. It is now read-only.
Hi! Thanks for your work on Sunder - loving it, learning plenty 🙏
I'm not sure if this issue is a bug, or user error…
I'm trying to add headers on the request object so that I can tweak the behaviour of sub-fetches (for caching and image resizing, etc).
I see that HeadersShorthands makes provision for this, but what I'm seeing is:
// in my middleware...ctx.request['x-foo-header']= 'bar
console.log(request['x-foo-header'])// 'bar'console.log(request.headers.get('x-foo-header'))// nullrequest.headers.set('x-foo-header','bar')// TypeError: immutable// at Headers.set ([/project/node_modules/undici/lib/fetch/headers.js:293:13]())
ctx.request['x-foo-header'] = 'bar' would similarly trigger the set trap and mutate request.headers
So I guess there are two issues here:
am I using the proxy correctly?
do the HeadersShorthands work as expected? I figure if the set trap was getting hit as expected, then I'd see a type error (I didn't find any relevant tests)