parse_lighter_retry_after

Documentation for eth_defi.lighter.session.parse_lighter_retry_after function.

parse_lighter_retry_after(value)

Read a Retry-After header without trusting its format.

Lighter does not document this header, so an unusable value must not turn a rate limit into a crash. urllib3’s parser covers both forms the header allows, seconds and an HTTP date. See RFC 9110.

Parameters

value (Optional[str]) – Header value, or None if the response had none.

Returns

Seconds to wait, or 0 if the header is missing or unusable.

Return type

float