We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi guys,
I found that oxy/buffer can't handle response with chunked encoding and empty body. I can reproduce it by adding the testcase below:
func TestEmptyChunkedResponse(t *testing.T) { srv := testutils.NewHandler(func(w http.ResponseWriter, req *http.Request) { h := w.(http.Hijacker) conn, _, _ := h.Hijack() _, _ = fmt.Fprintf(conn, "HTTP/1.1 200 OK\r\nTransfer-Encoding: chunked\r\n\r\n0\r\n\r\n") _ = conn.Close() }) t.Cleanup(srv.Close) fwd := forward.New(false) rdr := http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { req.URL = testutils.ParseURI(srv.URL) fwd.ServeHTTP(w, req) }) st, err := New(rdr) require.NoError(t, err) proxy := httptest.NewServer(st) t.Cleanup(proxy.Close) re, body, err := testutils.Get(proxy.URL) require.NoError(t, err) assert.Equal(t, "", string(body)) assert.Equal(t, http.StatusOK, re.StatusCode) }
I have test proxys like nginx and traefik with curl, they all looks fine. But if i use oxy/buffer, it will return 500 Internal Server Error
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi guys,
I found that oxy/buffer can't handle response with chunked encoding and empty body. I can reproduce it by adding the testcase below:
I have test proxys like nginx and traefik with curl, they all looks fine. But if i use oxy/buffer, it will return 500 Internal Server Error
The text was updated successfully, but these errors were encountered: