mirror of
https://github.com/rclone/rclone.git
synced 2024-12-23 15:38:57 +01:00
s3: fix v2 signer on files with spaces - fixes #2438
Before this fix the v2 signer was failing for files with spaces in.
This commit is contained in:
parent
0f02c9540c
commit
dbedf33b9f
@ -44,16 +44,7 @@ func sign(AccessKey, SecretKey string, req *http.Request) {
|
|||||||
req.Header.Set("Date", date)
|
req.Header.Set("Date", date)
|
||||||
|
|
||||||
// Sort out URI
|
// Sort out URI
|
||||||
uri := req.URL.Opaque
|
uri := req.URL.EscapedPath()
|
||||||
if uri != "" {
|
|
||||||
if strings.HasPrefix(uri, "//") {
|
|
||||||
// Strip off //host/uri
|
|
||||||
uri = "/" + strings.Join(strings.Split(uri, "/")[3:], "/")
|
|
||||||
req.URL.Opaque = uri // reset to plain URI otherwise Ceph gets confused
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
uri = req.URL.Path
|
|
||||||
}
|
|
||||||
if uri == "" {
|
if uri == "" {
|
||||||
uri = "/"
|
uri = "/"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user