This commit is contained in:
gospider
2025-02-27 09:02:46 +08:00
parent d7d7796b22
commit 068b80538f
7 changed files with 40 additions and 21 deletions

View File

@@ -198,8 +198,6 @@ func NewRequestWithContext(ctx context.Context, method string, u *url.URL, body
if body != nil {
if v, ok := body.(interface{ Len() int }); ok {
req.ContentLength = int64(v.Len())
} else {
req.ContentLength = -1
}
if _, ok := body.(io.Seeker); ok {
req.Body = &requestBody{body}
@@ -208,8 +206,6 @@ func NewRequestWithContext(ctx context.Context, method string, u *url.URL, body
} else {
req.Body = io.NopCloser(body)
}
} else {
req.ContentLength = -1
}
return req, nil
}