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

Fix wrong status code returning in case of handler with middleware.Timeout throws the panic #1864

Merged
merged 1 commit into from
May 8, 2021

Conversation

Bl1tz23
Copy link
Contributor

@Bl1tz23 Bl1tz23 commented Apr 28, 2021

I found out that when the echo.HandlerFunc with middleware.Timeout calls panic, global middleware.Recover() could return a wrong status code to the client, cause inside echoHandlerFuncWrapper.ServeHTTP method the originalWriter wasn't restored if handler throws the panic.
This pull request must fix this issue.

@codecov
Copy link

codecov bot commented May 8, 2021

Codecov Report

Merging #1864 (48fa624) into master (6430665) will increase coverage by 0.61%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1864      +/-   ##
==========================================
+ Coverage   89.57%   90.19%   +0.61%     
==========================================
  Files          31       31              
  Lines        2735     2765      +30     
==========================================
+ Hits         2450     2494      +44     
+ Misses        184      173      -11     
+ Partials      101       98       -3     
Impacted Files Coverage Δ
middleware/timeout.go 100.00% <100.00%> (ø)
middleware/jwt.go 79.80% <0.00%> (+1.91%) ⬆️
middleware/static.go 70.00% <0.00%> (+2.83%) ⬆️
middleware/key_auth.go 96.55% <0.00%> (+29.88%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6430665...48fa624. Read the comment docs.

@aldas aldas merged commit 2943a32 into labstack:master May 8, 2021
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.

None yet

2 participants