0.2.50
This commit is contained in:
@@ -566,6 +566,14 @@ func (s *Server) writeUpstreamError(
|
||||
case apiErr.StatusCode == http.StatusNotFound:
|
||||
writeError(w, http.StatusNotFound, "not found on the emby server")
|
||||
return
|
||||
case apiErr.StatusCode == http.StatusTooManyRequests:
|
||||
retryAfter := strings.TrimSpace(apiErr.RetryAfter)
|
||||
if retryAfter == "" {
|
||||
retryAfter = "60"
|
||||
}
|
||||
w.Header().Set("Retry-After", retryAfter)
|
||||
writeError(w, http.StatusTooManyRequests, "the emby server is receiving too many requests")
|
||||
return
|
||||
}
|
||||
}
|
||||
s.loggerFor(ctx).Error(message, "error", err)
|
||||
|
||||
Reference in New Issue
Block a user