Skip to content

Commit 68977c0

Browse files
committed
fix HTTP reponse codes.
1 parent 18745d8 commit 68977c0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

hls/manager.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
// how often should be cleanup called
2121
const cleanupPeriod = 4 * time.Second
2222

23-
// timeot for first playlist, when it waits for new data
23+
// timeout for first playlist, when it waits for new data
2424
const playlistTimeout = 60 * time.Second
2525

2626
// minimum segments available to consider stream as active
@@ -250,11 +250,11 @@ func (m *ManagerCtx) ServePlaylist(w http.ResponseWriter, r *http.Request) {
250250
// when command exits before providing any playlist
251251
case <-m.shutdown:
252252
m.logger.Warn().Msg("playlist load failed because of shutdown")
253-
http.Error(w, "404 playlist not found", http.StatusNotFound)
253+
http.Error(w, "500 playlist not available", http.StatusInternalServerError)
254254
return
255255
case <-time.After(playlistTimeout):
256256
m.logger.Warn().Msg("playlist load channel timeouted")
257-
http.Error(w, "500 not available", http.StatusInternalServerError)
257+
http.Error(w, "504 playlist timeout", http.StatusGatewayTimeout)
258258
return
259259
}
260260
}

0 commit comments

Comments
 (0)