“Accept” in request header is overwritten by default content type without feedback

Bug #1480036 reported by Lin Yang
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Murano
Fix Released
Medium
Lin Yang

Bug Description

When user specify one expected response content type that is not supported, it will be replaced with default type application/json without any feedback. In below case, a unsupported type "text/h323'' is specified, however, it response in application/json as usual.

How to reproduce:
$ curl -i -s -X GET -H "X-Auth-Token:<tokenid>" http://127.0.0.1:8082/v1/environments -H "Accept:text/h323"
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 20
Date: Fri, 31 Jul 2015 02:55:29 GMT

{"environments": []}

Expected behaviour:
One clear message tells user this type is unsupported.

Lin Yang (lin-a-yang)
Changed in murano:
assignee: nobody → Lin Yang (lin-a-yang)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to murano (master)

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

Changed in murano:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on murano (master)

Change abandoned by Lin Yang (<email address hidden>) on branch: master
Review: https://review.openstack.org/207705

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to murano (master)

Reviewed: https://review.openstack.org/207711
Committed: https://git.openstack.org/cgit/openstack/murano/commit/?id=0739bd29b9dc10daa2941980191e41086b5c8912
Submitter: Jenkins
Branch: master

commit 0739bd29b9dc10daa2941980191e41086b5c8912
Author: Lin Yang <email address hidden>
Date: Fri Jul 31 12:03:14 2015 +0800

    Warn user about unsupported content type

    1) Raise exception to user when the specified content type is unsupported, instead
    of silently replacing it to default type 'application/json'.
    2) Renamed 'InvalidContentType' exception to more clear name
    'UnsupportedContentType'.

    Change-Id: Id336fc4360f451f3b8febfb453e7d0d119ab9b01
    Closes-Bug: #1480036

Changed in murano:
status: In Progress → Fix Committed
Changed in murano:
importance: Undecided → Medium
milestone: none → liberty-3
Changed in murano:
status: Fix Committed → Fix Released
Changed in murano:
milestone: liberty-3 → 1.0.0
Changed in murano:
milestone: 1.0.0 → 1.0.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.