-
Notifications
You must be signed in to change notification settings - Fork 26.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When fetching a Request object in middleware, the method is ignored #37123
Comments
Hi, this should be fixed by #36539 which is available in |
Hi @ijjk, thanks for the update although I'm still seeing the issue with |
I believe this was reintroduced in #37024 |
…37540) There was a bug that ignored `Request` options when one was given to the `fetch` function: ```ts const request = new Request("https://example.vercel.sh", { method: "POST" }); await fetch(request); ``` The code above was expected to make a `POST` request, but instead it made a `GET` request. This commit fixes it and adds some tests to verify that fetching with a `Request` object works as expected, and therefore resolves #37123. ## Bug - [x] Related issues linked using `fixes #number` - [x] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md`
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Verify canary release
Provide environment information
What browser are you using? (if relevant)
n/a
How are you deploying your application? (if relevant)
next start
Describe the Bug
When fetching a Request object in middleware, the method is ignored:
This is related to #36522 (case 2 here, which I believe was lost in the shuffle).
Expected Behavior
Specified 'method' should be used for the request
To Reproduce
A simple repro we have in a middleware.ts:
The text was updated successfully, but these errors were encountered: