mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-04 11:19:39 -06:00
Merge pull request #10237 from aduffeck/signing-fixes
Work around a problem with reverse proxies changing URLs being signed
This commit is contained in:
@@ -160,6 +160,16 @@ func (m SignedURLAuthenticator) signatureIsValid(req *http.Request) (err error)
|
||||
if computedSignature == signatureInURL {
|
||||
return nil
|
||||
}
|
||||
|
||||
// try a workaround for https://github.com/owncloud/ocis/issues/10180
|
||||
// Some reverse proxies might replace $ with %24 in the URL leading to a mismatch in the signature
|
||||
u = strings.Replace(u, "$", "%24", 1)
|
||||
computedSignature = m.createSignature(u, signingKey[0].Value)
|
||||
signatureInURL = req.URL.Query().Get(_paramOCSignature)
|
||||
if computedSignature == signatureInURL {
|
||||
return nil
|
||||
}
|
||||
|
||||
return fmt.Errorf("signature mismatch: expected %s != actual %s", computedSignature, signatureInURL)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user