Fetch() defaults to 'get' as method (instead of 'GET')
Closed this issue · 2 comments
marienvo commented
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):
This seems to 'fix' the issue: const supportedMethods = ['get', 'GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'HEAD'];
Nanciee commented
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?
marienvo commented
Thanks! Only the lowercase 'get' gave issues for us, no other request types as far as we've experienced.