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

chore: update echo example #734

Merged
merged 1 commit into from
May 12, 2024
Merged

chore: update echo example #734

merged 1 commit into from
May 12, 2024

Conversation

bradydean
Copy link
Contributor

The previous implementation did not play nice with echo's error handler. The error handler does not override an already-set content-type, nor the response code (if already written to the underlying ResponseWriter), so error responses looked really weird. Eg you could get a code 200, content-type: text/html, with a json body.

This PR scraps that, and uses an implemtation really similar to what templ.Handler does, which is to allocate a byte buffer and render the component to that. This plays nice with the error handler and doesn't return any nonsense.

@a-h a-h merged commit 6a9dbff into a-h:main May 12, 2024
4 checks passed
@a-h
Copy link
Owner

a-h commented May 12, 2024

Thanks!

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.

2 participants