vendor: update github.com/ncw/swift to fix server side copy bug

This commit is contained in:
Nick Craig-Wood 2018-08-26 15:03:19 +01:00
parent 3751ceebdd
commit a64e0922b9
6 changed files with 63 additions and 36 deletions

11
vendor/github.com/ncw/swift/swift.go generated vendored
View file

@ -2079,6 +2079,15 @@ func (c *Connection) ObjectUpdate(container string, objectName string, h Headers
return err
}
// urlPathEscape escapes URL path the in string using URL escaping rules
//
// This mimics url.PathEscape which only available from go 1.8
func urlPathEscape(in string) string {
var u url.URL
u.Path = in
return u.String()
}
// ObjectCopy does a server side copy of an object to a new position
//
// All metadata is preserved. If metadata is set in the headers then
@ -2091,7 +2100,7 @@ func (c *Connection) ObjectUpdate(container string, objectName string, h Headers
func (c *Connection) ObjectCopy(srcContainer string, srcObjectName string, dstContainer string, dstObjectName string, h Headers) (headers Headers, err error) {
// Meta stuff
extraHeaders := map[string]string{
"Destination": dstContainer + "/" + dstObjectName,
"Destination": urlPathEscape(dstContainer + "/" + dstObjectName),
}
for key, value := range h {
extraHeaders[key] = value