`credentials` config not supported in node?
See original GitHub issueDescribe the bug
When I set the credentials
config in fetch
to 'omit'
that isn’t passed along to the req
.
Environment
msw: 0.0.18
nodejs: 12
npm: 6.14.5
To Reproduce
test('allows for config overrides', async () => {
let request
const endpoint = 'test-endpoint'
const mockResult = {mockValue: 'VALUE'}
server.use(
rest.get(`${apiURL}/${endpoint}`, async (req, res, ctx) => {
request = req
return res(ctx.json(mockResult))
}),
)
const customConfig = {
credentials: 'omit',
headers: {'Content-Type': 'fake-type'},
}
await client(endpoint, customConfig)
// TODO: this should pass but it's not...
// expect(request.credentials).toBe(customConfig.credentials)
expect(request.headers.get('Content-Type')).toBe(
customConfig.headers['Content-Type'],
)
})
Expected behavior
I expect the request.credentials to bet set to what is set in the window.fetch
call.
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (9 by maintainers)
Top Results From Across the Web
Missing credentials in config, if using AWS_CONFIG_FILE, set ...
When using credentials in plain text everything works good but when I am trying to use environment variables it's not working. Error message....
Read more >Setting Credentials in Node.js - AWS SDK for JavaScript
Credentials that are obtained by using a credential process specified in the shared AWS config file or the shared credentials file. For more...
Read more >Loading Credentials in Node.js from a JSON File - 亚马逊云科技
You can load configuration and credentials from a JSON document on disk using AWS.config.loadFromPath . The path specified is relative to the current ......
Read more >Credentials Configuration - NodePit
In such cases (resetting and) executing a downstream node will fail as the password is not part of the credentials object passed from...
Read more >@aws-sdk/credential-provider-node - npm
If invalid configuration is encountered (such as a profile in ~/.aws/credentials specifying as its source_profile the name of a profile that does not...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Interesting! In any case, it seems that this is out of scope for this module and it’s actually up to the polyfill to deal with this.
Also, it’s not critically important to me anyway so I’ll go ahead and just close this.
Thanks for the discussion everyone 😃
What they are doing that might be debated though, is assuming
same-origin
(the default) means “don’t include the credentials ever”, but that has already been discussed fairly extensively over here: https://github.com/whatwg/fetch/pull/585