fix: log discarded io.Copy error in proxy stream handler
This commit is contained in:
@@ -47,7 +47,9 @@ func (h *PlaybackHandler) HandleProxyStream(c *gin.Context) {
|
||||
|
||||
copyProxyHeaders(c.Writer.Header(), resp.Header)
|
||||
c.Status(resp.StatusCode)
|
||||
_, _ = io.Copy(c.Writer, resp.Body)
|
||||
if n, err := io.Copy(c.Writer, resp.Body); err != nil {
|
||||
observability.WarnContext(c.Request.Context(), "proxy_stream_copy_failed", "playback", "", map[string]any{"target_url": targetURL, "bytes_copied": n}, err)
|
||||
}
|
||||
}
|
||||
|
||||
func (h *PlaybackHandler) writeProxyPlaylist(c *gin.Context, resp *http.Response, targetURL string, referer string) {
|
||||
|
||||
Reference in New Issue
Block a user