fetch not following redirects
quick question about the HTTP Actions: I'm getting some inconsistencies in how the Fetch API works, and I'm not sure if they're expected
I have a shortlink, and if I fetch it, I would expect it to follow that redirect and then set
req.url
to the target URL. in Node, this happens how I expect. in Convex, I'm still getting the shortlink in req.url
is this intended behavior?8 Replies
This is a known shortcoming, the Convex runtime doesn't implement redirects or some of the options of the fetch API yet. This is on the list, we'll let you know when it's in.
gotcha. thanks!
second this ^
we'd really like to redirect from http convex endpoints
You can redirect from Convex http endpoints today, syntax looks like
the request in this thread is about
fetch()
calls initiated in V8 actions not following redirectsI see, thank you
@jlengstorf by the way, the Convex runtime already follows redirects in
fetch
(and always has). but it doesn't set Response.url
or Response.redirected
correctly. I'm working on those now and it should be working today or tomorrowthanks Lee! I knew it was following, which was great, but for my weird use case the specific thing I needed was the Response.url
this should be working now. let us know if you run into any more problems