File tree 1 file changed +7
-8
lines changed
transport/internet/splithttp
1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -168,21 +168,20 @@ func (h *requestHandler) ServeHTTP(writer http.ResponseWriter, request *http.Req
168
168
} else {
169
169
writer .Header ().Set ("X-Accel-Buffering" , "no" )
170
170
writer .Header ().Set ("Cache-Control" , "no-store" )
171
- if ! h .config .NoSSEHeader {
172
- writer .Header ().Set ("Content-Type" , "text/event-stream" )
173
- }
174
171
writer .WriteHeader (http .StatusOK )
175
172
if request .ProtoMajor != 1 && len (clientVer ) > 0 && clientVer [0 ] >= 25 {
176
173
go func () {
177
174
for {
178
175
paddingLen := h .config .GetNormalizedXPaddingBytes ().rand ()
179
- if paddingLen > 0 {
180
- _ , err := writer .Write (bytes .Repeat ([]byte {'0' }, int (paddingLen )))
181
- if err != nil {
182
- break
183
- }
176
+ if paddingLen <= 0 {
184
177
writer .(http.Flusher ).Flush ()
178
+ break
179
+ }
180
+ _ , err := writer .Write (bytes .Repeat ([]byte {'0' }, int (paddingLen )))
181
+ if err != nil {
182
+ break
185
183
}
184
+ writer .(http.Flusher ).Flush ()
186
185
time .Sleep (time .Duration (RangeConfig {From : 20 , To : 80 }.rand ()) * time .Second )
187
186
}
188
187
}()
You can’t perform that action at this time.
0 commit comments