Project

General

Profile

Actions

Feature #10648

open

content-type for object is not getting updated either during object create or update. Head operation always shows content-type as application/octet-stream.

Added by Ahmad Faheem about 9 years ago. Updated about 9 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
% Done:

0%

Source:
Q/A
Tags:
Backport:
Reviewed:
Affected Versions:
Pull request ID:

Description

Steps to rerpoduce:

1. swift post container
2. curl -i https://object.jiocloud.com:80/swift/v1/container/file1 -X PUT -H "Content-Length: 0" -H "X-Auth-Token: 24809d6b7f9848a29402bb682cd690d5" -H "content-type: text/plain" -d ""
3. swift stat container file1

Account: v1
Container: container
Object: file1
Content Type: application/octet-stream
Content Length: 0
Last Modified: Tue, 27 Jan 2015 10:33:59 GMT
ETag: d41d8cd98f00b204e9800998ecf8427e
Content-Encoding: gzip
Accept-Ranges: bytes
Vary: Accept-Encoding
Server: Apache/2.4.7 (Ubuntu)
Connection: close

ceph version: 0.80.8

Actions #1

Updated by Dmytro Yurchenko about 9 years ago

http://docs.openstack.org/api/openstack-object-storage/1.0/content/PUT_createOrReplaceObject__v1__account___container___object__storage_object_services.html
http://docs.openstack.org/api/openstack-object-storage/1.0/content/POST_updateObjectMeta__v1__account___container___object__storage_object_services.html

taken from these docs: Content-Type ?String (Optional) Changes the MIME type for the object.

Seems to be working OK in Hammer.

$ curl -I "http://localhost:8080/swift/v1/cont1/file1" -X POST -H "Content-Type: text/plain" -H "X-Auth-Token: $token"

HTTP/1.1 202 Accepted
Content-type: text/plain; charset=utf-8
Content-Length: 0

$ curl -i "http://localhost:8080/swift/v1/cont1/file1" -X HEAD -H "X-Auth-Token: $token"

HTTP/1.1 200 OK
Server: nginx/1.4.6 (Ubuntu)
Date: Wed, 04 Feb 2015 13:24:26 GMT
Content-Type: text/plain
Content-Length: 14
Connection: keep-alive
Accept-Ranges: bytes
Last-Modified: Wed, 04 Feb 2015 13:24:21 GMT
X-Timestamp: 1423056261
etag: e0bc568fc66f1e4d3ebaddf58dc07831

$ curl -I "http://localhost:8080/swift/v1/cont1/file1" -X POST -H "Content-Type: application/json" -H "X-Auth-Token: $token"

HTTP/1.1 202 Accepted
Content-type: text/plain; charset=utf-8
Content-Length: 0

$ curl -i "http://localhost:8080/swift/v1/cont1/file1" -X HEAD -H "X-Auth-Token: $token"

HTTP/1.1 200 OK
Server: nginx/1.4.6 (Ubuntu)
Date: Wed, 04 Feb 2015 13:24:44 GMT
Content-Type: application/json
Content-Length: 14
Connection: keep-alive
Accept-Ranges: bytes
Last-Modified: Wed, 04 Feb 2015 13:24:40 GMT
X-Timestamp: 1423056280
etag: e0bc568fc66f1e4d3ebaddf58dc07831

$ curl -I "http://localhost:8080/swift/v1/cont1/file1" -X PUT -H "Content-Type: application/xml" -H "X-Auth-Token: $token" -H "Content-Length: 0"

HTTP/1.1 201 Created
etag: d41d8cd98f00b204e9800998ecf8427e
Content-type: text/plain; charset=utf-8
Content-Length: 0

$ curl -i "http://localhost:8080/swift/v1/cont1/file1" -X HEAD -H "X-Auth-Token: $token"

HTTP/1.1 200 OK
Server: nginx/1.4.6 (Ubuntu)
Date: Wed, 04 Feb 2015 13:26:22 GMT
Content-Type: application/xml
Content-Length: 0
Connection: keep-alive
Accept-Ranges: bytes
Last-Modified: Wed, 04 Feb 2015 13:26:16 GMT
X-Timestamp: 1423056376
etag: d41d8cd98f00b204e9800998ecf8427e

Actions

Also available in: Atom PDF