1
0
mirror of https://github.com/imgproxy/imgproxy.git synced 2025-11-29 23:07:40 +02:00

Wrap custom transport bodies with a context reader

This commit is contained in:
DarthSim
2022-10-22 17:55:06 +06:00
parent 9bdc72ba34
commit 1403886840
5 changed files with 164 additions and 3 deletions

View File

@@ -12,6 +12,7 @@ import (
"github.com/ncw/swift/v2"
"github.com/imgproxy/imgproxy/v3/config"
"github.com/imgproxy/imgproxy/v3/ctxreader"
)
type transport struct {
@@ -105,7 +106,7 @@ func (t transport) RoundTrip(req *http.Request) (resp *http.Response, err error)
ProtoMajor: 1,
ProtoMinor: 0,
Header: header,
Body: object,
Body: ctxreader.New(req.Context(), object, true),
Close: true,
Request: req,
}, nil