elazarl / goproxy

An HTTP proxy library for Go
BSD 3-Clause "New" or "Revised" License
6.07k stars 1.1k forks source link

Handle 100-continue #367

Open abdollar opened 5 years ago

abdollar commented 5 years ago

The goproxy doesn't handle a 100-continue or doesn't provide an example to show how to handle the 100-continue. This seems to be a problem for proxies in general from what I can tell. I haven't had the time to debug this thoroughly but there seems to be a change in go 1.13 for managing expect/continue requests that seems to break goproxy.

See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Expect

Clients that send large payloads for PUT requests, such as aws s3 as an example, expect a ``100 continue``` response for an expect header request. An expect header looks like this :-

Expect: 100-continue

The proxy should respond with a 100 Continue but instead we see bad requests due to timeouts as the s3 server is still waiting for the body.

What is odd is that this all works with go 1.11.5 but breaks with go 1.13 and I haven't had the time to dig deeper into the issue but maybe the old golang version doesn't handle expect continue is my guess and now with go 1.13 it does and so we need to handle it in the proxy.

hazcod commented 4 years ago

@abdollar : were you able to fix this?

abdollar commented 4 years ago

@hazcod - no. I have not looked into fixing this at all. Feel free to take over.

castrapel commented 2 years ago

Has anyone been able to handle Expect: 100-continue with Go 1.18.2 ?

ujjwal commented 1 month ago

Are there any workarounds this issue?