@adobe/fetch
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -43,3 +43,8 @@ /* | ||
function capFirst(s) { | ||
return s[0].toUpperCase() + s.slice(1); | ||
} | ||
function addAuthHeaders(token, options, authOptions) { | ||
const tokenType = capFirst(token.token_type); | ||
let apiKey = authOptions.clientId; | ||
@@ -59,3 +64,3 @@ let xrequestid = uuid().replace(/-/g, ''); | ||
headers: { | ||
authorization: `${token.token_type} ${token.access_token}`, | ||
authorization: `${tokenType} ${token.access_token}`, | ||
'x-api-key': apiKey, | ||
@@ -62,0 +67,0 @@ 'x-request-id': xrequestid, |
{ | ||
"name": "@adobe/fetch", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "Call Adobe APIs", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -30,3 +30,3 @@ /* | ||
expect(options.headers).toBeDefined(); | ||
expect(options.headers['authorization']).toBe(`bearer ${access_token}`); | ||
expect(options.headers['authorization']).toBe(`Bearer ${access_token}`); | ||
expect(options.headers['x-api-key']).toBe(apikey); | ||
@@ -33,0 +33,0 @@ expect(options.headers['x-gw-ims-org-id']).toBe(orgid); |
@@ -77,3 +77,3 @@ /* | ||
expect(options.headers['authorization']).toBe( | ||
`${token.token_type} ${token.access_token}` | ||
`Bearer ${token.access_token}` | ||
); | ||
@@ -106,3 +106,3 @@ return Promise.resolve(mockData.responseOK); | ||
expect(options.headers['authorization']).toBe( | ||
`${token.token_type} ${token.access_token}` | ||
`Bearer ${token.access_token}` | ||
); | ||
@@ -109,0 +109,0 @@ return Promise.resolve(mockData.responseOK); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
73634
898