Reviewed: https://review.openstack.org/10119 Committed: http://github.com/openstack/nova/commit/9ac962cc82ef55cf211c0dfa5d18bc5bde27563b Submitter: Jenkins Branch: master
commit 9ac962cc82ef55cf211c0dfa5d18bc5bde27563b Author: Mark McLoughlin <email address hidden> Date: Mon Jul 23 09:32:30 2012 +0100
Avoid unrecognized content-type message
Fixes bug #904473
If the client does not include a Content-type header in its request (which is normal for e.g. GET and DELETE) then eventlet will pass us 'text/plain'.
Because 'text/plain' isn't one of our supported request content types we log:
Unrecognized Content-Type provided in request
This can be an annoying red-herring for people debugging issues.
The reason that eventlet defaults to text/plain is because it uses the mimetools.Message.gettype() method:
Message.gettype() Return the message type [..] as specified in the Content-Type header. If no such header exists, return 'text/plain'.
The wsgiref web server has the same behavior, whereas mod_wsgi will pass no content-type and twisted will pass an empty string.
Make our code more robust by treating the empty string or text/plain as if no content-type header was supplied.
Change-Id: Ide117c807db0dc0f5cbe974788b604b5e236800a
Reviewed: https:/ /review. openstack. org/10119 github. com/openstack/ nova/commit/ 9ac962cc82ef55c f211c0dfa5d18bc 5bde27563b
Committed: http://
Submitter: Jenkins
Branch: master
commit 9ac962cc82ef55c f211c0dfa5d18bc 5bde27563b
Author: Mark McLoughlin <email address hidden>
Date: Mon Jul 23 09:32:30 2012 +0100
Avoid unrecognized content-type message
Fixes bug #904473
If the client does not include a Content-type header in its request
(which is normal for e.g. GET and DELETE) then eventlet will pass us
'text/plain'.
Because 'text/plain' isn't one of our supported request content types
we log:
Unrecognized Content-Type provided in request
This can be an annoying red-herring for people debugging issues.
The reason that eventlet defaults to text/plain is because it uses Message. gettype( ) method:
the mimetools.
Message. gettype( )
Return the message type [..] as specified in the Content-Type
header. If no such header exists, return 'text/plain'.
The wsgiref web server has the same behavior, whereas mod_wsgi will
pass no content-type and twisted will pass an empty string.
Make our code more robust by treating the empty string or text/plain
as if no content-type header was supplied.
Change-Id: Ide117c807db0dc 0f5cbe974788b60 4b5e236800a