Add RFC-8246 support to CacheControl

This commit adds the "immutable" Cache-Control directives in `CacheControl`.

Closes gh-29955
This commit is contained in:
Toshiaki Maki
2023-02-10 23:07:31 +09:00
committed by Brian Clozel
parent 84c7f07364
commit 616e7779e0
2 changed files with 23 additions and 0 deletions

View File

@@ -101,4 +101,10 @@ public class CacheControlTests {
assertThat(cc.getHeaderValue()).isEqualTo("max-age=3600, stale-while-revalidate=7200");
}
@Test
public void immutable() throws Exception {
CacheControl cc = CacheControl.maxAge(Duration.ofHours(1)).immutable();
assertThat(cc.getHeaderValue()).isEqualTo("max-age=3600, immutable");
}
}