Bug #10690
RGW swift API: Response returned by query with temp url and inline parameter does not contain content-disposition header
0%
Description
content-disposition metadata for object is supported by rgw and can be added either by POST or PUT request. If this metadata is not added and object is accessed using temp url rgw does not return content-disposition header but in swift it returns content-disposition header in this scenario.
Steps to reproduce:
1. swift post container
2. swift upload container file1
3. generate temp-url for GET using the link https://gist.github.com/theanalyst/c9a81e33d27f8a9bafbc.
4. curl -i "https://10.20.20.15:80/swift/v1/container1/file1?temp_url_sig=68b3f402980500393d63f543cb0da509ce90f23f&temp_url_expires=1422535523"
HTTP/1.1 200 OK
Date: Thu, 29 Jan 2015 12:42:35 GMT
Server: Apache/2.4.7 (Ubuntu)
Accept-Ranges: bytes
Last-Modified: Thu, 29 Jan 2015 12:42:27 GMT
etag: 764efa883dda1e11db47671c4a3bbd9e
X-Object-Meta-mtime: 1422535335.014666
Content-Length: 3
Content-Type: application/octet-stream
Connection: close
content-disposition not returned in the above query. same query with inline parameter also does not return content-disposition header.
5. curl -i "https://object.jiocloud.com:80/swift/v1/container1/file1?temp_url_sig=abc5f7a77173a88f3f9706232b6031f8ab3d30ee&temp_url_expires=1422536931&inline"
HTTP/1.1 200 OK
Date: Thu, 29 Jan 2015 13:04:11 GMT
Server: Apache/2.4.7 (Ubuntu)
Accept-Ranges: bytes
Last-Modified: Thu, 29 Jan 2015 12:42:27 GMT
etag: 764efa883dda1e11db47671c4a3bbd9e
X-Object-Meta-mtime: 1422535335.014666
Content-Length: 3
Content-Type: application/octet-stream
Connection: close
In swift headers returned by step 4 and 5 are:
4. curl -i "http://10.0.2.15:8080/v1/AUTH_b2419ea9588d49ddbd8c006b5eb199ff/container/file1?temp_url_sig=8f674fa301607b4cb9be455265444887aefde03c&temp_url_expires=1422541396"
HTTP/1.1 200 OK
Content-Length: 3
Accept-Ranges: bytes
Last-Modified: Wed, 28 Jan 2015 14:26:45 GMT
Etag: 764efa883dda1e11db47671c4a3bbd9e
X-Timestamp: 1422455204.53691
Content-Type: application/octet-stream
Content-Disposition: attachment; filename="file1"; filename*=UTF-8''file1
X-Trans-Id: tx3959581f16044ca1bf08c-0054c8f7f4
Date: Wed, 28 Jan 2015 14:53:40 GMT
5. curl -i "http://10.0.2.15:8080/v1/AUTH_b2419ea9588d49ddbd8c006b5eb199ff/container/file1?temp_url_sig=8f674fa301607b4cb9be455265444887aefde03c&temp_url_expires=1422541396&inline"
HTTP/1.1 200 OK
Content-Length: 3
Accept-Ranges: bytes
Last-Modified: Wed, 28 Jan 2015 14:26:45 GMT
Etag: 764efa883dda1e11db47671c4a3bbd9e
X-Timestamp: 1422455204.53691
Content-Type: application/octet-stream
Content-Disposition: inline
X-Trans-Id: txd5d95b1eddc84e078df80-0054c8f805
Date: Wed, 28 Jan 2015 14:53:57 GMT
History
#1 Updated by Casey Bodley about 4 years ago
- Assignee set to Mark Kogan
- Tags set to tempurl
#2 Updated by Mark Kogan almost 4 years ago
Tested against master
ceph --version *** DEVELOPER MODE: setting PATH, PYTHONPATH and LD_LIBRARY_PATH *** ceph version 13.0.0-32477-gc1f3f05011 (c1f3f050110c07afe75a5f8754ce5d627836dd26) octopus (rc) does not reproduce.
Following the reproducer procedure outlined by OP, the 'content-disposition' header exists:
curl -I "http://127.0.0.1:8000/swift/v1/sbkt/rgw-010.svg?temp_url_sig=392fc60fe00c2188d91bc5e3f591404cf68f5ece&temp_url_expires=1587377075&inline" ^^^^^^ HTTP/1.1 200 OK accept-ranges: bytes last-modified: Sun, 19 Apr 2020 09:06:30 GMT x-timestamp: 1587287190.07435 etag: fd353bda326142b9b568a748a9d87032 x-object-meta-mtime: 1527668559.845106 content-disposition: inline ^^^^^^^^^^^^^^^^^^^^^^^^^^^ x-trans-id: tx000000000000000000027-005e9c25c6-10cb-default x-openstack-request-id: tx000000000000000000027-005e9c25c6-10cb-default content-type: image/svg+xml date: Sun, 19 Apr 2020 10:19:50 GMT connection: close transfer-encoding: chunked
#3 Updated by Mark Kogan almost 4 years ago
- Status changed from New to Can't reproduce