Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fetch() defaults to 'get' as method (instead of 'GET') #40

Closed
marienvo opened this issue Jan 6, 2021 · 2 comments
Closed

Fetch() defaults to 'get' as method (instead of 'GET') #40

marienvo opened this issue Jan 6, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@marienvo
Copy link

marienvo commented Jan 6, 2021

In our project the browsers fetch() function seems to default the request method to get (instead of uppercase GET); and since the supportedMethods array is all uppercase, this breaks our tests when running with the recorded mocks.

Recording is fine though, but the JSON is incompatible (or lowercase get needs to be added to supportedMethods):

Screenshot from 2021-01-06 11-32-01

This seems to 'fix' the issue: const supportedMethods = ['get', 'GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'HEAD'];

@Nanciee
Copy link
Owner

Nanciee commented Jan 7, 2021

Thanks for raising this! I'll add in a quick fix this for this. Was this only limited to 'get' or would other request types need to be added as well?

@Nanciee Nanciee added the bug Something isn't working label Jan 7, 2021
Nanciee added a commit that referenced this issue Jan 14, 2021
@Nanciee Nanciee closed this as completed Jan 14, 2021
@marienvo
Copy link
Author

Thanks! Only the lowercase 'get' gave issues for us, no other request types as far as we've experienced.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants