Skip to content

Commit

Permalink
don't parse empty Retry-After header
Browse files Browse the repository at this point in the history
  • Loading branch information
barrettj12 committed Aug 17, 2023
1 parent 8d68852 commit eb38985
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internals/overlord/logstate/loki/loki.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,10 @@ func (c *Client) handleServerResponse(resp *http.Response) error {
// Gets the parsed value of Retry-After from HTTP response headers.
func getRetryAfter(resp *http.Response) (time.Time, bool) {
retryAfterRaw := resp.Header.Get("Retry-After")
if retryAfterRaw == "" {
// Header unset
return time.Time{}, false
}

// The Retry-After value can be a date-time
t, err := http.ParseTime(retryAfterRaw)
Expand Down

0 comments on commit eb38985

Please sign in to comment.