Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix broken content_type #66

Merged
merged 1 commit into from Apr 30, 2016
Merged

Conversation

zoffixznet
Copy link
Contributor

Currently, setting content_type is ignored. This change fixes it. There's no need to set text/html as default in render method because it's set to that value elsewhere.

@ufobat
Copy link
Member

ufobat commented Apr 30, 2016

Thank you!

You are right. I am not even sure if defaulting it to "text/html" is even a good idea. Maybe a generic "application/octet-stream" is best.

It might help for this fallback as well.

According to the RFC

Any HTTP/1.1 message containing an entity-body SHOULD include a
Content-Type header field defining the media type of that body. If
and only if the media type is not given by a Content-Type field, the
recipient MAY attempt to guess the media type via inspection of its
content and/or the name extension(s) of the URI used to identify the
resource. If the media type remains unknown, the recipient SHOULD
treat it as type "application/octet-stream".
-- RFC2616

@ufobat ufobat merged commit a06a0b5 into Bailador:master Apr 30, 2016
@zoffixznet zoffixznet deleted the fix-content-type branch April 30, 2016 11:14
@zoffixznet
Copy link
Contributor Author

I am not even sure if defaulting it to "text/html" is even a good idea.

But then all routes would have to explicitly set Content Type. Considering a Web Framework is to server text/html pages, I think the current default is sane.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants