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
The headers merging logic assumes JavaScript objects and key value pairs. The TypeScript types though allow using fetch Headers. When using fetch Headers, since they're not plain object, anything that sets headers will override them (eg: using a .post with an object as argument, or the .content helper).
I think the easiest fix is to tweak the types as to now allow fetch Headers as argument in the types, but alternatively a slightly smarter merge logic that accounts for Headers object would work too. Threw me in for a loop digging why my authorization headers were going poof right before a post request but not a get.
The text was updated successfully, but these errors were encountered:
The headers merging logic assumes JavaScript objects and key value pairs. The TypeScript types though allow using fetch Headers. When using fetch Headers
Thanks for reporting this issue, I just published v2.7.1 which now converts the headers() argument to a record and will merge properly no matter the type.
The headers merging logic assumes JavaScript objects and key value pairs. The TypeScript types though allow using fetch Headers. When using fetch Headers, since they're not plain object, anything that sets headers will override them (eg: using a .post with an object as argument, or the .content helper).
I think the easiest fix is to tweak the types as to now allow fetch Headers as argument in the types, but alternatively a slightly smarter merge logic that accounts for Headers object would work too. Threw me in for a loop digging why my authorization headers were going poof right before a post request but not a get.
The text was updated successfully, but these errors were encountered: