Enforce content-type

Registered by Jonas

The freezer-api currently does NOT enforce the http field content-type. All openstack projects I checked, expect the content-type to be present.

Example:

--------------------------------------------------

curl -X POST http://192.168.122.92:5000/v3/auth/tokens -d "
{
    "auth": {
        "identity": {
            "methods": [
                "password"
            ],
            "password": {
                "user": {
                    "id": "423f19a4ac1e4f48bbb4180756e6eb6c",
                    "password": "devstacker"
                }
            }
        }
    }
}
"
{"error": {"message": "Expecting to find application/json in Content-Type header - the server could not comply with the request since it is either malformed or otherwise incorrect. The client is assumed to be in error.", "code": 400, "title": "Bad Request"}}
--------------------------------------------------

A similar blueprints from our neighbors: https://specs.openstack.org/openstack/barbican-specs/specs/juno/barbican-enforce-content-type.html

Please note that this will break api compatibility. I'm not aware of any clients outside the freezer project using this api but we need to be careful.

Affected components
==================

Clients:

- freezer-web-ui
- python-freezerclient
- freezer-scheduler

I believe most of them are based on the freezer/apiclient code so changing this code should be enough. Are there any other clients I'm not aware of?

Server:

- freezer-api

Blueprint information

Status:
Not started
Approver:
None
Priority:
Undefined
Drafter:
Jonas
Direction:
Needs approval
Assignee:
None
Definition:
New
Series goal:
None
Implementation:
Unknown
Milestone target:
None

Related branches

Sprints

Whiteboard

Gerrit topic: https://review.openstack.org/#q,topic:bp/contenttype,n,z

Addressed by: https://review.openstack.org/323793
    Enforce content-type in request headers

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.