This repository has been archived by the owner on May 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 25
Formatters should include a Content-Type #21
Comments
shadowhand
changed the title
Formatting should include a Content-Type
Formatters should include a Content-Type
Mar 30, 2015
👍 |
1 similar comment
👍 |
This won't work. Any time the headers have already been sent, this will produce another error, creating an endless loop. |
@brandonsavage that can be changed. The formatted response can be generated before printing any output or sending headers. |
Suppose somebody is writing an application, and in their template, halfway through rendering the page, they reference a variable that is not in scope. They trigger a notice. Under this scheme we'll attempt to send headers back when headers have already been sent. That simply won't end well. |
@brandonsavage that could happen but I think it is fairly uncommon practice to not have output buffering in place. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Formatters should also do something like this:
So that when the formatted output is returned, the appropriate type can be set:
The text was updated successfully, but these errors were encountered: