Skip to content

Commit

Permalink
pr feedback (eugene)
Browse files Browse the repository at this point in the history
  • Loading branch information
jurassix committed Feb 12, 2024
1 parent 9a75a2c commit f98f1b8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 1 addition & 2 deletions relay/traffic/encoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ func GetContentEncoding(request *http.Request) (Encoding, error) {
}
}

// WrapReader checks if the request Content-Encoding or request query parameter indicates gzip compression.
// If so, it returns a gzip.Reader that decompresses the content.
// WrapReader returns a wrapped request.Body for the encoding provided.
func WrapReader(request *http.Request, encoding Encoding) (io.ReadCloser, error) {
if request.Body == nil {
return nil, nil
Expand Down
2 changes: 2 additions & 0 deletions relay/traffic/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ func (handler *Handler) HandleRequest(clientResponse http.ResponseWriter, client
}
}

// ensureBodyContentEncoding operates on the assumption that the downstream proxy target will be using the same
// encoding as what the relay received and ensures we proxy the content encoded correctly.
func (handler *Handler) ensureBodyContentEncoding(clientRequest *http.Request, encoding Encoding) {
switch encoding {
case Unsupported:
Expand Down

0 comments on commit f98f1b8

Please sign in to comment.