Skip to content

Commit 2fdd7c1

Browse files
mmmrayFangliding
andcommitted
Make SplitHTTP work under CF Argo (#3479)
* Make SplitHTTP work under CF Argo * Update hub.go --------- Co-Authored-By: 风扇滑翔翼 <[email protected]>
1 parent e4f9d03 commit 2fdd7c1

File tree

1 file changed

+3
-0
lines changed
  • transport/internet/splithttp

1 file changed

+3
-0
lines changed

transport/internet/splithttp/hub.go

+3
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,9 @@ func (h *requestHandler) ServeHTTP(writer http.ResponseWriter, request *http.Req
161161

162162
// magic header instructs nginx + apache to not buffer response body
163163
writer.Header().Set("X-Accel-Buffering", "no")
164+
// magic header to make the HTTP middle box consider this as SSE to disable buffer
165+
writer.Header().Set("Content-Type", "text/event-stream")
166+
164167
writer.WriteHeader(http.StatusOK)
165168
// send a chunk immediately to enable CDN streaming.
166169
// many CDN buffer the response headers until the origin starts sending

0 commit comments

Comments
 (0)