Compare commits

...

2 Commits

Author SHA1 Message Date
Joon
d0bd8bbec8
Merge d2415e54db2617848cd2d0ac194b4c722c93fca0 into 2e22e5085960205fbb11c25776f6ea76b8053253 2025-11-04 10:20:57 -05: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 {