ironic/ironic/api/middleware
Dmitry Tantsur cfc167eadf Stop guessing mime types based on URLs
Currently we have a pecan feature enabled that strips extensions
from the end of the URL and treat it like requested content type.
E.g. /v1/nodes.json is treated as /v1/nodes with requested content
type Application/Json. However, this prevents certain node names:
e.g. /v1/nodes/small.1 is treated like /v1/nodes/small with content
type of a man page. It does not make any sense for ironic API,
as we only support Application/Json content type (and .json suffix).

This change disabled this pecan feature. To keep backward compability
a new middleware stips the .json prefix and saves a flag in the
environment about its presence. API accepting names try to find
their resource first without, then with .json suffix.

The following endpoints are special-cased to support names with .json:
* Node GET, PATCH and DELETE
* Ramdisk heartbeat
* Port group GET, PATCH and DELETE

VIF API is not updated, so VIF IDs still cannot have .json suffix.

Change-Id: I789ecfeac9b64a9c4105a20619f7bf5dfc133189
Closes-Bug: #1643995
2018-02-07 20:58:35 +00:00
..
__init__.py Stop guessing mime types based on URLs 2018-02-07 20:58:35 +00:00
auth_token.py TrivialFix: Remove logging import unused 2017-04-26 17:32:06 +07:00
json_ext.py Stop guessing mime types based on URLs 2018-02-07 20:58:35 +00:00
parsable_error.py Remove translation of log messages from ironic/api 2017-04-05 09:53:58 -07:00