Browse Source

SplitHTTP server: Only "ok" to older clients (#3671)

https://github.com/XTLS/Xray-core/pull/3643#issuecomment-2282304185
pull/3674/head
mmmray 3 months ago committed by GitHub
parent
commit
513182adf3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 3
      transport/internet/splithttp/hub.go

3
transport/internet/splithttp/hub.go

@ -192,12 +192,15 @@ func (h *requestHandler) ServeHTTP(writer http.ResponseWriter, request *http.Req
h.config.WriteResponseHeader(writer) h.config.WriteResponseHeader(writer)
writer.WriteHeader(http.StatusOK) writer.WriteHeader(http.StatusOK)
if _, ok := request.URL.Query()["x_padding"]; !ok {
// in earlier versions, this initial body data was used to immediately // in earlier versions, this initial body data was used to immediately
// start a 200 OK on all CDN. but xray client since 1.8.16 does not // start a 200 OK on all CDN. but xray client since 1.8.16 does not
// actually require an immediate 200 OK, but now requires these // actually require an immediate 200 OK, but now requires these
// additional bytes "ok". xray client 1.8.24+ doesn't require "ok" // additional bytes "ok". xray client 1.8.24+ doesn't require "ok"
// anymore, and so this line should be removed in later versions. // anymore, and so this line should be removed in later versions.
writer.Write([]byte("ok")) writer.Write([]byte("ok"))
}
responseFlusher.Flush() responseFlusher.Flush()
downloadDone := done.New() downloadDone := done.New()

Loading…
Cancel
Save