Glance returned 500 status code when we specify headers "Content-Type: application/json" when work with blob/bloblist

Bug #1490903 reported by Darja Shakhray
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
Undecided
Darja Shakhray

Bug Description

ENVIRONMENT: devstack, Glance (master, 31.08.2015)

STEPS TO REPRODUCE:
Send request
1) curl -H "X-Auth-Token: 9863593190284361af174f3b9ec39e8c" -H "Content-Type:application/json" -X POST -d '{"data": "ssss"}' http://172.18.76.44:9292/v3/artifacts/myartifact/v2.0/2a787efd-c724-46ab-9de2-6f2e896be473/image_file -i

2) curl -H "X-Auth-Token: 9863593190284361af174f3b9ec39e8c" -H "Content-Type:application/json" -X POST -d '{"data": "ssss"}' http://172.18.76.44:9292/v3/artifacts/myartifact/v2.0/2a787efd-c724-46ab-9de2-6f2e896be473/screenshots -i

EXPECTED RESULT:
status code 400 and error message

ACTUAL RESULT:
HTTP/1.1 500 Internal Server Error
Content-Length: 228
Content-Type: text/html; charset=UTF-8
X-Openstack-Request-Id: req-3210dabf-baf8-4d0b-9afa-ab826a1a5d36
Date: Tue, 01 Sep 2015 09:33:29 GMT

<html>
 <head>
  <title>500 Internal Server Error</title>
 </head>
 <body>
  <h1>500 Internal Server Error</h1>
  The server has either erred or is incapable of performing the requested operation.<br /><br />

 </body>
</html>

Tags: artifacts
Revision history for this message
Kairat Kushaev (kkushaev) wrote :

There is couple of moments:
1. We should not allow to have content_type: octet-stream for PATCH
2. When I tried to execute the same query with application/json it is still failing:)

Changed in glance:
assignee: nobody → dshakhray (dshakhray)
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/221056

Changed in glance:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance (master)

Reviewed: https://review.openstack.org/221056
Committed: https://git.openstack.org/cgit/openstack/glance/commit/?id=a11ba6d4cde8e861ebce77dd19986aa6a3072c66
Submitter: Jenkins
Branch: master

commit a11ba6d4cde8e861ebce77dd19986aa6a3072c66
Author: Darja Shakhray <email address hidden>
Date: Mon Sep 7 18:18:54 2015 +0300

    Fix 500 error when we specify invalid headers when work with blob/bloblist

    When specify header "Content-Type: application/json" when work
    with blob/bloblist, Glance returns 500 status code.
    Added check for compliance "Content-Type".

    ApiImpact
    FastTrack

    Change-Id: Ic89d6b6697d808e9ace37ac6de40c8d0e06bb345
    Closes-bug: #1490903

Changed in glance:
status: In Progress → Fix Released
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.