Skip to content

Commit

Permalink
Speedup ClassRoutingHandler/FixedProducesHandler lookups
Browse files Browse the repository at this point in the history
  • Loading branch information
franz1981 committed Dec 12, 2023
1 parent 0b7462d commit 3b88ac0
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ public FixedProducesHandler(MediaType mediaType, EntityWriter writer) {

@Override
public void handle(ResteasyReactiveRequestContext requestContext) throws Exception {
List<String> acceptValues = (List<String>) requestContext.getHeader(HttpHeaders.ACCEPT, false);
if (acceptValues.isEmpty() || requestContext.isProducesChecked()) {
List<String> acceptValues;
if (requestContext.isProducesChecked() ||
(acceptValues = (List<String>) requestContext.getHeader(HttpHeaders.ACCEPT, false)).isEmpty()) {
requestContext.setResponseContentType(mediaType);
requestContext.setEntityWriter(writer);
} else {
Expand Down

0 comments on commit 3b88ac0

Please sign in to comment.