x-versions-enabled objects do not support if-match conditional GET
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Object Storage (swift) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
I think I have some understanding of how if-match conditional GET requests are supposed to work.
Given an object with both a dynamic and static link:
vagrant@saio:~$ swift list test --json
[
{
"bytes": 0,
"content_type": "application/
"hash": "d41d8cd98f00b2
"last_
"name": "hardlink",
"symlink_path": "/v1/AUTH_
},
{
"bytes": 0,
"content_type": "application/
"hash": "d41d8cd98f00b2
"last_
"name": "link",
"symlink_path": "/v1/AUTH_
},
{
"bytes": 8,
"content_type": "application/
"hash": "70c1db56f301c9
"last_
"name": "test"
}
]
You can make GET/HEAD requests with if-match: <etag> header and swift will only respond 200 if the etag matches:
vagrant@saio:~$ curl -s -H 'x-auth-token: AUTH_tkc0d886a2
HTTP/1.1 200 OK
vagrant@saio:~$ curl -s -H 'x-auth-token: AUTH_tkc0d886a2
HTTP/1.1 200 OK
vagrant@saio:~$ curl -s -H 'x-auth-token: AUTH_tkc0d886a2
HTTP/1.1 200 OK
vagrant@saio:~$ curl -s -H 'x-auth-token: AUTH_tkc0d886a2
HTTP/1.1 412 Precondition Failed
vagrant@saio:~$ curl -s -H 'x-auth-token: AUTH_tkc0d886a2
HTTP/1.1 412 Precondition Failed
vagrant@saio:~$ curl -s -H 'x-auth-token: AUTH_tkc0d886a2
HTTP/1.1 412 Precondition Failed
This API behavior doesn't seem to follow on versioned objects:
vagrant@saio:~$ swift list vtest --json --versions
[
{
"bytes": 8,
"content_type": "application/
"hash": "70c1db56f301c9
"is_latest": true,
"last_
"name": "test",
"version_id": "1590178192.84163"
}
]
vagrant@saio:~$ curl -s -H 'x-auth-token: AUTH_tkc0d886a2
HTTP/1.1 200 OK
vagrant@saio:~$ curl -s -H 'x-auth-token: AUTH_tkc0d886a2
HTTP/1.1 200 OK
Which seems surprising.
This bug only exists in https:/ /review. opendev. org/#/c/ 724393/ 2 and we'll fix it before we merge it