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

Use Content_Type as other headers #72

merged 2 commits into from Jan 14, 2014


None yet
2 participants

nicolas-rempulski commented Jan 12, 2014

This PR comes from a misuse I did : I tried to set the Content_Type header through with(CONTENT_TYPE, "xxx"). While not entirely wrong (with() set headers), documentation clearly states to use as() function.
In my case, Result.contentType wasn't initialized as the function as() was not called and the auto-detection set the Content_Type header as it saw it as null.

My first solution was to call as() if with() was called with Content_Type header.

But, to ensure this problem doesn't occur anymore, I entirely removed the Result.contentType field and replaced it with a setter. Thus the only location of the Content_Type header is in the Result.headers map.

nicolas-rempulski added some commits Jan 12, 2014

Change setContentType visibility to private
Change setContentType visibility to private to match replaced Render.contentType visibility

cescoffier added a commit that referenced this pull request Jan 14, 2014

@cescoffier cescoffier merged commit 150f6b7 into master Jan 14, 2014


This comment has been minimized.

Show comment
Hide comment

cescoffier Jan 14, 2014




cescoffier commented Jan 14, 2014


@nicolas-rempulski nicolas-rempulski deleted the content-type-through-with branch Jan 14, 2014

@cescoffier cescoffier added this to the 0.4.0 milestone Apr 4, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment