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

Default error page content-type to text/html #1535

Merged

Conversation

Projects
None yet
4 participants
@hdm
Copy link
Contributor

commented Jan 15, 2019

This replaces PR #1534 (based on master) with a patch based on the development branch. It looks like this branch already covers the common case of a form submission, but it may not make sense to reflect the client's content type for any other non-xml/json responses.

The error handler only supports html, xml, and json responses; this PR ensures that the content-type will be correct in those three situations.

@hdm hdm requested a review from gobuffalo/core-managers as a code owner Jan 15, 2019

@hdm hdm changed the title Default error page content-type to html/text Default error page content-type to text/html Jan 15, 2019

Show resolved Hide resolved errors.go Outdated
Show resolved Hide resolved errors.go Outdated
Show resolved Hide resolved errors.go Outdated
@hdm

This comment has been minimized.

Copy link
Contributor Author

commented Jan 16, 2019

I updated the two variable names; let me know if you would like to see any further changes around this.

Use static content-type values for error responses
The default of application/json comes from RFC 4627,
text/xml from RFC 3023. Production and development
HTML responses use text/html with charset utf-8.
@senorprogrammer

This comment has been minimized.

Copy link

commented Jan 27, 2019

It seems this PR is failing the spec run because the Test_defaultErrorHandler_XML spec still expect application/xml as the type.

@hdm

This comment has been minimized.

Copy link
Contributor Author

commented Jan 27, 2019

@senorprogrammer thanks! fixed in 8fb2459

@markbates markbates added this to the v0.14.0 milestone Jan 27, 2019

@markbates markbates merged commit 92e1150 into gobuffalo:development Jan 28, 2019

2 checks passed

code-analysis/fixmie The Fixmie analysis has finished
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.