keystoneauth shouldn't replace content-type header for request with json body

Bug #1634110 reported by Mike Fedosin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
keystoneauth
Fix Released
Undecided
Mike Fedosin

Bug Description

Currently if keystoneauth1 sees that request body contains json it forcibly sets content-type to application/json [1], which is not correct, because it may be different, like "application/json-patch+json".

It leads to the fact that some requests are sending with incorrect ct and fail.

[1] https://github.com/openstack/keystoneauth/blob/master/keystoneauth1/session.py#L545-L547

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

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

Changed in keystoneauth:
assignee: nobody → Mike Fedosin (mfedosin)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystoneauth (master)

Reviewed: https://review.openstack.org/387415
Committed: https://git.openstack.org/cgit/openstack/keystoneauth/commit/?id=ab39cf066784dc01869a7e22a9289e154410e4e5
Submitter: Jenkins
Branch: master

commit ab39cf066784dc01869a7e22a9289e154410e4e5
Author: Mike Fedosin <email address hidden>
Date: Mon Oct 17 15:50:28 2016 +0300

    Prevent changing content type in request

    Now if body contains json, its content type forcibly
    changes to application/json, which is not correct in
    some case, like json-patch request.

    This code fixes this situation and sets application/json
    contnent type only if this header hasn't been set before.

    Change-Id: I4e0c44d444519f056dfa48c9603dbc3ca6b01822
    Closes-bug: #1634110

Changed in keystoneauth:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/keystoneauth 2.15.0

This issue was fixed in the openstack/keystoneauth 2.15.0 release.

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.