Skip to content

Commit cefe9dd

Browse files
fix!: Capitalize "Authorization" header name (#252)
HTTP headers are case insensitive, however "Authorization" is a standard header name. Relevant documentation: - https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization - https://tools.ietf.org/html/rfc7235#section-4.2 Co-authored-by: Guillaume Chau <[email protected]>
1 parent d6aa49e commit cefe9dd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

graphql-client/src/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ export function createApolloClient ({
7676

7777
// HTTP Auth header injection
7878
authLink = setContext(async (_, { headers }) => {
79-
const authorization = await getAuth(tokenName)
80-
const authorizationHeader = authorization ? { authorization } : {}
79+
const Authorization = await getAuth(tokenName)
80+
const authorizationHeader = Authorization ? { Authorization } : {}
8181
return {
8282
headers: {
8383
...headers,
@@ -122,8 +122,8 @@ export function createApolloClient ({
122122
wsClient = new SubscriptionClient(wsEndpoint, {
123123
reconnect: true,
124124
connectionParams: () => {
125-
const authorization = getAuth(tokenName)
126-
return authorization ? { authorization, headers: { authorization } } : {}
125+
const Authorization = getAuth(tokenName)
126+
return Authorization ? { Authorization, headers: { Authorization } } : {}
127127
},
128128
})
129129

0 commit comments

Comments
 (0)