protected function deriveTimeoutFromHeader($headerValue)
    {
        // The timeout will either be a number or a HTTP-formatted date,
        // or seconds (integer)
        if ((string) (int) trim($headerValue) === $headerValue) {
            return (int) trim($headerValue);
        } elseif ($date = \DateTime::createFromFormat(self::DATE_FORMAT, trim($headerValue))) {
            return (int) $date->format('U') - time();
        }

        return null;
    }