Cloudflare Worker TypeError: One-time-us...
Hello,
I'm trying to build a reverse proxy where I'll use the cloudflare domain to proxy from a site. Now the application sends
302
when the user is signed out, and then I get to send a post request with the login information. The code below works, in the sense that it follows the redirects, but when I submit the form I get the following error:
I checked, https://stackoverflow.com/questions/55920957/cloudflare-worker-typeerror-one-time-use-body and started buffering the body if it's present but I still get the same error, here is my code:
The console.log(req.body)
output still shows a ReadableStream
How can I fix this error?Stack Overflow
Cloudflare Worker TypeError: One-time-use body
I'm trying to use a Cloudflare Worker to proxy a POST request to another server.
It is throwing a JS exception – by wrapping in a try/catch blog I've established that the error is:
TypeError: A
2 Replies
What is strange is that the backend server (
gdk.test:3000
) is getting the POST request just fine
The backend server is responding with a 302 for a redirectI ended up fixing this by overriding the
location
header in https://gitlab.com/gitlab-org/tenant-scale-group/pocs/routing/rules-router/-/commit/a51e9eff77361f26a8c0dcba300248e5cc3f2d34GitLab
fix(router): handle redirects (a51e9eff) · Commits · GitLab.org / T...
What --- Handle redirects for things like loging in, POST requests Why --- When we send a success
POST /user/sign_in
is sent we get a 302, with a header `location:...