NAME

Net::ACME2::RetryAfter - Parse RFC 7231 Retry-After header values

DESCRIPTION

This module parses the Retry-After HTTP header (RFC 7231, section 7.1.3) into an integer number of seconds. The header value may be either a non-negative integer (delay-seconds) or an HTTP-date.

This is used internally by Net::ACME2::Order and Net::ACME2::Authorization.

FUNCTIONS

parse( $VALUE )

Parses a Retry-After header value and returns the number of seconds to wait (a non-negative integer), or undef if $VALUE is undefined or cannot be parsed.

If $VALUE is a non-negative integer, it is returned as-is.

If $VALUE is an HTTP-date (IMF-fixdate, RFC 850, or asctime format), the difference between that time and the current time is returned. If the date is in the past, 0 is returned.