fix: handle close errors

This commit is contained in:
2026-05-12 16:05:36 +02:00
parent 31796543c2
commit b03e90fc47
15 changed files with 36 additions and 33 deletions

View File

@@ -140,7 +140,7 @@ func (s *Service) probeDirectMedia(ctx context.Context, source StreamSource) (bo
if err != nil {
return false, ""
}
defer resp.Body.Close()
defer func() { _ = resp.Body.Close() }()
// check content-type header first
contentType := strings.ToLower(resp.Header.Get("Content-Type"))
@@ -192,7 +192,7 @@ func (s *Service) probeEmbedSource(ctx context.Context, source StreamSource) boo
if err != nil {
return false
}
defer resp.Body.Close()
defer func() { _ = resp.Body.Close() }()
if resp.StatusCode >= http.StatusBadRequest {
return false