Incorrect Content-Type can upload image

Bug #1241387 reported by Xurong Yang
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Glance
Fix Released
Medium
Zhi Yan Liu

Bug Description

Incorrect Content-Type can upload image,details are as follows:
...
upload image using incorrect Content-Type:
curl -i -H "Content-Type:application/octet-st" -H "X-Auth-Token:480194c5e9a046b9be8150c80c7f439b" -X PUT -T ./test.img http://127.0.0.1:9292/v2/images/04059ffa-56fa-4f67-a294-fdc10372e634/file

Content-Type is application/octet-st but not application/octet-stream,is it a bug?

Revision history for this message
Feilong Wang (flwang) wrote :

I'm wondering if it can be recreated based on the code: https://github.com/openstack/glance/blob/master/glance/api/v2/image_data.py#L148

Can you please create it again and post the glance api log? Thanks.

Zhi Yan Liu (lzy-dev)
Changed in glance:
assignee: nobody → Zhi Yan Liu (lzy-dev)
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glance (master)

Fix proposed to branch: master
Review: https://review.openstack.org/52878

Changed in glance:
status: Confirmed → In Progress
Zhi Yan Liu (lzy-dev)
Changed in glance:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance (master)

Reviewed: https://review.openstack.org/52878
Committed: http://github.com/openstack/glance/commit/b316059835798875403b4e60fddad8e2976c0b28
Submitter: Jenkins
Branch: master

commit b316059835798875403b4e60fddad8e2976c0b28
Author: Zhi Yan Liu <email address hidden>
Date: Mon Oct 21 16:59:04 2013 +0800

    Fixes content-type checking for image uploading in API v1 and v2

    wsgi.Request.get_content_type() need a list or set for
    allowed_content_types as parameter, but API controller passes request's
    content type as a string into it directly. This caused 'in' testing
    failure.

    Fixes bug: 1241387

    Change-Id: I820ccce92e4ec1c94b5144309d6ebe2b57baaf55
    Signed-off-by: Zhi Yan Liu <email address hidden>

Changed in glance:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in glance:
milestone: none → icehouse-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in glance:
milestone: icehouse-1 → 2014.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.