rackerlabs/deuce — pull request #56 by BenjamenMeyer (2014-07-31 18:27:15+00:00)
Title: WIP: Bugfix Get File wrong content type

- Fixes bug in the Get File end-point where the response header contained 'text/html;utf-8' instead of 'application/binary' or even 'application/octet-datastream'.
- Removes the Auth Token check from the ProjectIdHook
- Adds new AuthTokenHook
- Adds test coverage for the AuthTokenHook in the root controller test
- Makes explicit the test for the ProjectIdHook in the root controller test

Note: pecan.Response object is really the WebOb.response.Response object. See http://webob.readthedocs.org/en/latest/modules/webob.html for details. It has some funky behavior regarding the content-type information. Specifically setting content-type to "application/binary" will just append the existing content-type information, so you still get "application/binary;utf-8"; while setting it to "application/binary;" will make it drop anything and only set it to "application/binary;". This seems backwards, but is how it works.

TODO: When setting the content-type to "application/binary;" as this PR does, it now fails to set the content-length. Need to figure how to get the content-length. Open to suggestions.