mirror of
https://github.com/rclone/rclone.git
synced 2024-12-23 15:38:57 +01:00
vendor: update github.com/ncw/swift to fix server side copy bug
This commit is contained in:
parent
3751ceebdd
commit
a64e0922b9
6
Gopkg.lock
generated
6
Gopkg.lock
generated
@ -250,12 +250,12 @@
|
||||
revision = "887eb06ab6a255fbf5744b5812788e884078620a"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:7a4827b2062a21ba644241bdec27959a5be2670f8aa4038ba14cfe2ce389e8d2"
|
||||
digest = "1:e5b9ef2c82d0c904496a3fd6b14e34081df4d425d42d8e57d182ac3d8c93e98a"
|
||||
name = "github.com/ncw/swift"
|
||||
packages = ["."]
|
||||
pruneopts = ""
|
||||
revision = "b2a7479cf26fa841ff90dd932d0221cb5c50782d"
|
||||
version = "v1.0.39"
|
||||
revision = "a0320860b16212c2b59b4912bb6508cda1d7cee6"
|
||||
version = "v1.0.40"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
|
27
vendor/github.com/ncw/swift/.travis.yml
generated
vendored
27
vendor/github.com/ncw/swift/.travis.yml
generated
vendored
@ -2,26 +2,29 @@ language: go
|
||||
sudo: false
|
||||
|
||||
go:
|
||||
- 1.1.2
|
||||
- 1.2.2
|
||||
- 1.3.3
|
||||
- 1.4.3
|
||||
- 1.5.4
|
||||
- 1.6.4
|
||||
- 1.7.5
|
||||
- 1.8
|
||||
- 1.1.x
|
||||
- 1.2.x
|
||||
- 1.3.x
|
||||
- 1.4.x
|
||||
- 1.5.x
|
||||
- 1.6.x
|
||||
- 1.7.x
|
||||
- 1.8.x
|
||||
- 1.9.x
|
||||
- 1.10.x
|
||||
- 1.11.x
|
||||
- master
|
||||
|
||||
matrix:
|
||||
include:
|
||||
- go: 1.8
|
||||
- go: 1.11.x
|
||||
env: TEST_REAL_SERVER=rackspace
|
||||
- go: 1.8
|
||||
- go: 1.11.x
|
||||
env: TEST_REAL_SERVER=memset
|
||||
allow_failures:
|
||||
- go: 1.8
|
||||
- go: 1.11.x
|
||||
env: TEST_REAL_SERVER=rackspace
|
||||
- go: 1.8
|
||||
- go: 1.11.x
|
||||
env: TEST_REAL_SERVER=memset
|
||||
install: go test -i ./...
|
||||
script:
|
||||
|
39
vendor/github.com/ncw/swift/README.md
generated
vendored
39
vendor/github.com/ncw/swift/README.md
generated
vendored
@ -26,26 +26,27 @@ See here for full package docs
|
||||
- http://godoc.org/github.com/ncw/swift
|
||||
|
||||
Here is a short example from the docs
|
||||
```go
|
||||
import "github.com/ncw/swift"
|
||||
|
||||
import "github.com/ncw/swift"
|
||||
|
||||
// Create a connection
|
||||
c := swift.Connection{
|
||||
UserName: "user",
|
||||
ApiKey: "key",
|
||||
AuthUrl: "auth_url",
|
||||
Domain: "domain", // Name of the domain (v3 auth only)
|
||||
Tenant: "tenant", // Name of the tenant (v2 auth only)
|
||||
}
|
||||
// Authenticate
|
||||
err := c.Authenticate()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
// List all the containers
|
||||
containers, err := c.ContainerNames(nil)
|
||||
fmt.Println(containers)
|
||||
// etc...
|
||||
// Create a connection
|
||||
c := swift.Connection{
|
||||
UserName: "user",
|
||||
ApiKey: "key",
|
||||
AuthUrl: "auth_url",
|
||||
Domain: "domain", // Name of the domain (v3 auth only)
|
||||
Tenant: "tenant", // Name of the tenant (v2 auth only)
|
||||
}
|
||||
// Authenticate
|
||||
err := c.Authenticate()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
// List all the containers
|
||||
containers, err := c.ContainerNames(nil)
|
||||
fmt.Println(containers)
|
||||
// etc...
|
||||
```
|
||||
|
||||
Additions
|
||||
---------
|
||||
|
11
vendor/github.com/ncw/swift/swift.go
generated
vendored
11
vendor/github.com/ncw/swift/swift.go
generated
vendored
@ -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
|
||||
|
14
vendor/github.com/ncw/swift/swift_test.go
generated
vendored
14
vendor/github.com/ncw/swift/swift_test.go
generated
vendored
@ -1479,6 +1479,20 @@ func TestObjectCopy(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestObjectCopyDifficultName(t *testing.T) {
|
||||
c, rollback := makeConnectionWithObjectHeaders(t)
|
||||
defer rollback()
|
||||
const dest = OBJECT + "?param %30%31%32 £100"
|
||||
_, err := c.ObjectCopy(CONTAINER, OBJECT, CONTAINER, dest, nil)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
err = c.ObjectDelete(CONTAINER, dest)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestObjectCopyWithMetadata(t *testing.T) {
|
||||
c, rollback := makeConnectionWithObjectHeaders(t)
|
||||
defer rollback()
|
||||
|
2
vendor/github.com/ncw/swift/travis_realserver.sh
generated
vendored
2
vendor/github.com/ncw/swift/travis_realserver.sh
generated
vendored
@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
if [ ! "${TRAVIS_BRANCH}" = "master" ]; then
|
||||
if [ "${TRAVIS_PULL_REQUEST}" = "true" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user