eliben / code-for-blog

Code samples from my blog
The Unlicense
1.54k stars 743 forks source link

Proxy hangs while reading the HTTP request body #67

Open nsingl00 opened 2 weeks ago

nsingl00 commented 2 weeks ago

I am using the proxy to intercept my S3 POST request before sending it to destination.

For this, I need to read the request body. If I try to read the body, It just hangs and later gives "Unexpected EOF" which happens when the body has been read somewhere upstream. When I look at the proxy, I see that it is reading the request here and my suspicion is, request.body not getting closed.

How can I read the request body here?

Thanks

eliben commented 1 week ago

Can you more specifically explain the setup you're using?