fix: revert "refactor(net): pass request header" (#8269)

5be50e77d9
This commit is contained in:
j2rong4cn
2025-04-03 20:35:52 +08:00
committed by GitHub
parent affd0cecd1
commit a6304285b6
3 changed files with 5 additions and 13 deletions

View File

@ -114,7 +114,7 @@ func ServeHTTP(w http.ResponseWriter, r *http.Request, name string, modTime time
// 使用请求的Context
// 不然从sendContent读不到数据即使请求断开CopyBuffer也会一直堵塞
ctx := context.WithValue(r.Context(), "request_header", &r.Header)
ctx := context.WithValue(r.Context(), "request_header", r.Header)
switch {
case len(ranges) == 0:
reader, err := RangeReadCloser.RangeRead(ctx, http_range.Range{Length: -1})