Compare commits

...

2 Commits

Author SHA1 Message Date
Joon
bfc0f3f7e8
Merge d2415e54db2617848cd2d0ac194b4c722c93fca0 into c3d5a28ed6d3849da820195b6774d212bcc038a9 2025-11-08 09:52:26 +01:00
adshield-joon
d2415e54db
Trea http.ErrAbortHandler as broken pipe
```
ErrAbortHandler is a sentinel panic value to abort a handler.
While any panic from ServeHTTP aborts the response to the client, panicking with ErrAbortHandler also suppresses logging of a stack trace to the server's error log.
```

- CC - #1714
- similar to https://github.com/gorilla/handlers/pull/159/files
- Other PR: https://github.com/gin-gonic/gin/pull/2590
2023-02-02 15:31:58 -05:00

View File

@ -68,6 +68,9 @@ func CustomRecoveryWithWriter(out io.Writer, handle RecoveryFunc) HandlerFunc {
}
}
}
if errors.Is(err, http.ErrAbortHandler) {
brokenPipe = true
}
if logger != nil {
const stackSkip = 3
if brokenPipe {