Skip to content

Commit

Permalink
fix proxy retry body (#327)
Browse files Browse the repository at this point in the history
  • Loading branch information
tnsetting2023 authored Oct 19, 2024
1 parent 611f3d7 commit f171b13
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/proxy/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ func (p *Proxy) forwardRequest(acct *account.Account, w http.ResponseWriter, req
writeJSONError(w, http.StatusBadGateway, err)
return
}
req.Body = io.NopCloser(bytes.NewBuffer(requestBody))
proxyReq.Body = io.NopCloser(bytes.NewBuffer(requestBody))
}

for {
Expand Down Expand Up @@ -259,8 +259,8 @@ func (p *Proxy) forwardRequest(acct *account.Account, w http.ResponseWriter, req
log.Debug("Received HTTP Status 421. Updating server URL to %s", altHost)
acct.Host = altHost
p.updateDomainForSubject(acct.Subject, acct.Host)
if req.Body != nil {
req.Body = io.NopCloser(bytes.NewBuffer(requestBody))
if proxyReq.Body != nil {
proxyReq.Body = io.NopCloser(bytes.NewBuffer(requestBody))
}
} else {
for _, hdr := range connectionHeaders {
Expand Down

0 comments on commit f171b13

Please sign in to comment.