You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a POST request with redirect: follow is answered with a 307 status code, an exception is thrown due to accessing an undefined options object.
Reproduction
Given a minimal server pseudo-setup like this:
importexpressfrom"express";constapp=express();constport=3000;app.use(express.static("public"));app.post("/",(req,res)=>{res.redirect(307,"/foobar");});app.post("/foobar",(req,res)=>{res.send("ok");});app.listen(port,()=>{console.log(`Example app listening on port ${port}`);});
I also have this problem and it seems that the problem is solved with the newly opened PR.
But after 16 months since the issue was opened, it still hasn't been merged.
When a
POST
request withredirect: follow
is answered with a307
status code, an exception is thrown due to accessing an undefined options object.Reproduction
Given a minimal server pseudo-setup like this:
Using
fetch
like this:results in following error:
Expected behavior
Follow the redirect and send the
POST
request to the new location.This is how
fetch
in the browser seems to behave (tested with Chrome and Firefox).As the second parameter to
fetch
is optional, the behavior should be the same as callingfetch(request, {})
, which works as expected.Your Environment
The text was updated successfully, but these errors were encountered: