(cc: CacheControl)
| 417 | * valid HTTP token (RFC 9110 §5.6.2). |
| 418 | */ |
| 419 | export function formatCacheControl(cc: CacheControl): string { |
| 420 | const d: CacheControl = cc; |
| 421 | const out: string[] = []; |
| 422 | append(out, "max-age", d.maxAge); |
| 423 | append(out, "no-cache", d.noCache); |
| 424 | append(out, "no-store", d.noStore); |
| 425 | append(out, "no-transform", d.noTransform); |
| 426 | append(out, "max-stale", d.maxStale); |
| 427 | append(out, "min-fresh", d.minFresh); |
| 428 | append(out, "only-if-cached", d.onlyIfCached); |
| 429 | append(out, "s-maxage", d.sMaxage); |
| 430 | append(out, "private", d.private); |
| 431 | append(out, "public", d.public); |
| 432 | append(out, "must-revalidate", d.mustRevalidate); |
| 433 | append(out, "proxy-revalidate", d.proxyRevalidate); |
| 434 | append(out, "must-understand", d.mustUnderstand); |
| 435 | append(out, "immutable", d.immutable); |
| 436 | append(out, "stale-while-revalidate", d.staleWhileRevalidate); |
| 437 | append(out, "stale-if-error", d.staleIfError); |
| 438 | |
| 439 | return out.join(", "); |
| 440 | } |
no test coverage detected