Parse a comma-separated list of HTTP field names from a directive argument. * Strips surrounding double quotes if present and unescapes any quoted-pair * sequence (RFC 9110 §5.6.4). Returns an array of trimmed, non-empty field * names.
(value: string)
| 208 | * sequence (RFC 9110 §5.6.4). Returns an array of trimmed, non-empty field |
| 209 | * names. */ |
| 210 | function parseFieldNames(value: string): string[] { |
| 211 | return unquoteArgument(value) |
| 212 | .split(",") |
| 213 | .map((s) => s.trim()) |
| 214 | .filter(Boolean); |
| 215 | } |
| 216 | |
| 217 | /** |
| 218 | * Parses a `Cache-Control` header value into a typed object. Returns an empty |
no test coverage detected