mirror of
https://github.com/imgproxy/imgproxy.git
synced 2025-06-17 22:37:33 +02:00
Fix path before signature check
This commit is contained in:
@ -6,7 +6,7 @@
|
|||||||
- (pro) Add encrypted source URL support.
|
- (pro) Add encrypted source URL support.
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
- Fix some invalid signature cases that happen because of URL normalization.
|
- Try to fix some invalid source URL cases that happen because of URL normalization.
|
||||||
|
|
||||||
## [3.7.2] - 2022-08-22
|
## [3.7.2] - 2022-08-22
|
||||||
### Changed
|
### Changed
|
||||||
|
@ -217,14 +217,10 @@ func handleProcessing(reqID string, rw http.ResponseWriter, r *http.Request) {
|
|||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := security.VerifySignature(signature, path); err != nil {
|
path = fixPath(path)
|
||||||
// Some proxy servers may normalize URL and make signature invalid.
|
|
||||||
// Try to fix the path and repeat the check
|
|
||||||
path = fixPath(path)
|
|
||||||
|
|
||||||
if err = security.VerifySignature(signature, path); err != nil {
|
if err := security.VerifySignature(signature, path); err != nil {
|
||||||
sendErrAndPanic(ctx, "security", ierrors.New(403, err.Error(), "Forbidden"))
|
sendErrAndPanic(ctx, "security", ierrors.New(403, err.Error(), "Forbidden"))
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
po, imageURL, err := options.ParsePath(path, r.Header)
|
po, imageURL, err := options.ParsePath(path, r.Header)
|
||||||
|
Reference in New Issue
Block a user