Surprising behaviour when object names have spaces
Bug #1670917 reported by
wolever
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Object Storage (swift) |
New
|
Undecided
|
Unassigned | ||
python-swiftclient |
New
|
Undecided
|
Unassigned |
Bug Description
400 instead of 404 is returned when a key with a space that does not exist is requested.
For example:
> client.
400 Bad Request
> client.
200 OK
> client.
200 OK
"foo"
To post a comment you must log in.
Context and timing lead me to believe this is related to lp bug #1670915
I haven't figured out yet which client supports an interface like the above...
Normally we hope the body of the 400 response would have the details needed to understand the error - ideally the client would expose that detail in an exception/ error/return- value.
This is problematic in python- swiftclient' s case because the first request to hit the error is acctually a pre-flight HEAD request :\
ubuntu@saio:~$ swift upload test test --object-name "a b" saio:8080/ v1/AUTH_ test/test/ a%20b 400 Bad Request
Object HEAD failed: http://
You can dig around result['error'] all you want; the resp that builds the ClientException just doesn't have a body.
If you can get past that [1] we do expose some of the response body by default:
ubuntu@saio:~$ swift upload test test --object-name "a b" saio:8080/ v1/AUTH_ test/test/ a%20b 400 Bad Request [first 60 chars of response] Object/ Container/ Account name contains forbidden chars from
Object PUT failed: http://
1. attached patch is probably a terrible idea