diff --git a/handler/proxy_client.go b/handler/proxy_client.go index beb8032..bee8853 100644 --- a/handler/proxy_client.go +++ b/handler/proxy_client.go @@ -56,6 +56,17 @@ func (p *ProxyClient) sign(req *http.Request, service *endpoints.ResolvedEndpoin body = bytes.NewReader(b) } + // S3 service should not have any escaping applied. + // https://github.com/aws/aws-sdk-go/blob/main/aws/signer/v4/v4.go#L467-L470 + if (service.SigningName == "s3") { + p.Signer.DisableURIPathEscaping = true + + // Enable URI escaping for subsequent calls. + defer func() { + p.Signer.DisableURIPathEscaping = false + }() + } + var err error switch service.SigningMethod { case "v4", "s3v4":