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 object on the request passed to a request middleware function is of type Headers, which yields an empty object when spread. The examples in the repo show usage as below.
const requestMiddleware: RequestMiddleware = async (request) => {
return {
...request,
headers: {
...request.headers,
^^^^^^^^^^^^^^^^^^ This always yields an empty object so any headers passed to the request call are lost.
'x-auth-token': await getAccessToken(),
},
}
}
Ideas / Proposed Solution(s)
I guess there's a couple of options here - modify createFetcher to convert the headers to a plain object before passing in or update the examples to show something like below.
Perceived Problem
The headers object on the request passed to a request middleware function is of type
Headers
, which yields an empty object when spread. The examples in the repo show usage as below.Ideas / Proposed Solution(s)
I guess there's a couple of options here - modify
createFetcher
to convert the headers to a plain object before passing in or update the examples to show something like below.The text was updated successfully, but these errors were encountered: