We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 000e6ca commit ad56877Copy full SHA for ad56877
gusto_embedded/src/ReactSDKProvider.tsx
@@ -17,16 +17,14 @@ export function ReactSDKProvider({
17
}) {
18
const httpClientWithHeaders = new HTTPClient({
19
fetcher: async (request) => {
20
- if (request instanceof Request) {
21
- const requestWithHeaders = {
22
- ...request,
23
- headers: {
24
- ...request.headers,
25
- ...headers,
26
- },
27
- };
28
- return fetch(requestWithHeaders);
+ if (request instanceof Request && headers) {
+ headers.forEach((headerValue, headerName) => {
+ if (headerValue) {
+ request.headers.set(headerName, headerValue);
+ }
+ });
29
}
+
30
return fetch(request);
31
},
32
});
0 commit comments