Skip to content

Commit

Permalink
Don't send body with 403
Browse files Browse the repository at this point in the history
In most cases the client is not a browser.

Fixes quarkusio#5998
  • Loading branch information
stuartwdouglas authored and gsmet committed Jul 16, 2020
1 parent 9729e1e commit e2ff301
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
@Provider
@Priority(Priorities.USER + 1)
public class ForbiddenExceptionMapper implements ExceptionMapper<ForbiddenException> {

@Override
public Response toResponse(ForbiddenException exception) {
return Response.status(403).entity("Forbidden").build();
return Response.status(403).build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,6 @@ public void callEcho2() {
.get("/endp/echo2").andReturn();

Assertions.assertEquals(HttpURLConnection.HTTP_FORBIDDEN, response.getStatusCode());
String replyString = response.body().asString();
Assertions.assertEquals("Forbidden", replyString);
}

/**
Expand Down Expand Up @@ -245,8 +243,6 @@ public void echoWithToken2() throws Exception {
.get("/endp/echo").andReturn();

Assertions.assertEquals(HttpURLConnection.HTTP_FORBIDDEN, response.getStatusCode());
String replyString = response.body().asString();
Assertions.assertEquals("Forbidden", replyString);
}

/**
Expand Down

0 comments on commit e2ff301

Please sign in to comment.