* @see https://www.rfc-editor.org/rfc/rfc9110.html#name-date-time-formats * * @param {string} date * @returns {Date | undefined}
(date)
| 7 | * @returns {Date | undefined} |
| 8 | */ |
| 9 | function parseHttpDate (date) { |
| 10 | // Sun, 06 Nov 1994 08:49:37 GMT ; IMF-fixdate |
| 11 | // Sun Nov 6 08:49:37 1994 ; ANSI C's asctime() format |
| 12 | // Sunday, 06-Nov-94 08:49:37 GMT ; obsolete RFC 850 format |
| 13 | |
| 14 | switch (date[3]) { |
| 15 | case ',': return parseImfDate(date) |
| 16 | case ' ': return parseAscTimeDate(date) |
| 17 | default: return parseRfc850Date(date) |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | /** |
| 22 | * @see https://httpwg.org/specs/rfc9110.html#preferred.date.format |
no test coverage detected
searching dependent graphs…