Neutron API - problem parsing semi-colon in Accept header

Bug #1887815 reported by Dan Radez
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
In Progress
High
Dan Radez

Bug Description

when GET is sent with “Accept: application/json; charset=utf-8”, we receive the following Neutron error:

$ curl -s -H "Accept: application/json; charset=utf-8" -H "X-Auth-Token: $OS_TOKEN" "http://10.240.50.25:9696/v2.0/networks" | python -mjson.tool

{
    "NeutronError": {

        "detail": "",

        "message": "The server could not comply with the request since it is either malformed or otherwise incorrect.",

        "type": "HTTPNotAcceptable"

    }

}

This happens on core resources and not extension resources.

Tags: api
Revision history for this message
Dan Radez (dradez) wrote :

WebOb seems to be handling this properly according to this github issue:
https://github.com/Pylons/webob/issues/403

According to the RFC this Accept header is valid syntax:
https://tools.ietf.org/html/rfc7231#section-3.1.1

Changed in neutron:
assignee: nobody → Dan Radez (dradez)
status: New → In Progress
Revision history for this message
Dan Radez (dradez) wrote :

Originally verified on Rocky.
Now verified on master too.

Revision history for this message
Lajos Katona (lajos-katona) wrote :

Thanks for the bug report, I checked and /agents works for example, but /networks or /ports not.

Changed in neutron:
importance: Undecided → High
Revision history for this message
Dan Radez (dradez) wrote :

In Neutron the core resources are handled by V2Controller and the non-core are handled by Controller. This leads me to believe we should resolve the issue assuming that V2Controller would seem to be newer than controller. Question remains the difference in handling.

I've also reproduced this at the pecan level with a basic tutorial pecan app.
If you create a generic pecan app and set the content_type to "application/json" for the index the same behavior manifests.

tags: added: api
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.