Skip to content

fix: improve error handling and response for EchoWrapHandler - #129

Merged
ubogdan merged 2 commits into
swaggo:masterfrom
tturbs:writeheader
Jun 25, 2025
Merged

ubogdan merged 2 commits into
swaggo:masterfrom
tturbs:writeheader

Conversation

@tturbs

@tturbs tturbs commented Jun 24, 2025 •

Copy link
Copy Markdown
Contributor

Describe the PR
The echo.HandlerFunc in Echo should call ResponseWriter.WriteHeader() and ResponseWriter.Write() in that order before sending a response, which you can access via c.Response(). Since the c.XXX() functions wrap these calls (as explained in the Echo response documentation), it's best to use those functions when sending a response.

Relation issue
#128

Additional context

The `echo.HandlerFunc` in Echo should call `ResponseWriter.WriteHeader()` and `ResponseWriter.Write()` in that order before sending a response, which you can access via `c.Response()`.
Since the `c.XXX()` functions wrap these calls (as explained in [the Echo response documentation](https://echo.labstack.com/docs/response)), it's best to use those functions when sending a response.
@tturbs

tturbs commented Jun 24, 2025

Copy link
Copy Markdown
Contributor Author

@ubogdan
I removed part of your commit f82eac4
Could you review this PR?

@ubogdan

ubogdan commented Jun 25, 2025

Copy link
Copy Markdown
Contributor

@tturbs Thanks for your contribution!

@ubogdan
ubogdan merged commit ec17715 into swaggo:master Jun 25, 2025
@tturbs
tturbs deleted the writeheader branch June 26, 2025 01:51
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

⌂ 换网址