sentry-javascript
sentry-javascript copied to clipboard
fix(core): Parse method from Request object in fetch
[!NOTE] The pull request "fix(core): Parse method from Request object in fetch" was created by @s1gr1d but did not reference an issue. Therefore this issue was created for better visibility in external tools like Linear.
Fixes the case that the instrumentation defaulted to GET in case undefined was parsed as a second fetch argument.
const request = new Request("https://httpbin.org/post", { method: "POST" });
const response = await fetch(request, undefined); // <-- will be GET (should be POST)