Skip to content

Commit

Permalink
[grid] Testing skip checks for content type works [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
diemol committed Sep 4, 2020
1 parent aa7eac8 commit dd49967
Showing 1 changed file with 9 additions and 0 deletions.
Expand Up @@ -45,6 +45,15 @@ public void shouldBlockRequestsWithNoContentType() {
assertThat(res.getStatus()).isEqualTo(HTTP_INTERNAL_ERROR);
}

@Test
public void shouldAllowRequestsWithNoContentTypeWhenSkipCheckOnMatches() {
HttpResponse res = new EnsureSpecCompliantHeaders(ImmutableList.of(), ImmutableSet.of("/gouda"))
.apply(alwaysOk)
.execute(new HttpRequest(POST, "/gouda"));

assertThat(res.getStatus()).isEqualTo(HTTP_OK);
}

@Test
public void requestsWithAnOriginHeaderShouldBeBlocked() {
HttpResponse res = new EnsureSpecCompliantHeaders(ImmutableList.of(), ImmutableSet.of())
Expand Down

0 comments on commit dd49967

Please sign in to comment.