Skip to content

Commit

Permalink
Add test for Cache-Control override (#2341)
Browse files Browse the repository at this point in the history
  • Loading branch information
pkoenig10 authored Aug 15, 2024
1 parent be4aedc commit 089d22b
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,13 @@ public void testCacheControl() throws IOException {
assertThat(connection.getHeaderField(HttpHeaders.CACHE_CONTROL))
.isEqualTo("no-cache, no-store, must-revalidate");
}

@Test
public void testCacheControl_override() throws IOException {
URL url = new URL("http://localhost:12345?override=true");
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("GET");
connection.getHeaderField(HttpHeaders.CACHE_CONTROL);
assertThat(connection.getHeaderField(HttpHeaders.CACHE_CONTROL)).isEqualTo("custom override");
}
}

0 comments on commit 089d22b

Please sign in to comment.