Retry-After is always set to l.windowLength, rather than the seconds remaining till the end of the current window, to reduce the likelihood of creating thundering hurds at window intervals. I don't have a strong opinion about that and would be happy to change it.
This allows services using httprate to work with http clients that expect the standard Retry-After header described in RFC 6585, such as hashicorp/go-retryablehttp's DefaultBackoff and curl 7.66+.
Retry-After is always set to l.windowLength, rather than the seconds remaining till the end of the current window, to reduce the likelihood of creating thundering hurds at window intervals. I don't have a strong opinion about that and would be happy to change it.