Skip to content

Commit

Permalink
Replace CONTENT_TYPE String with Vertx optimized one and make fast-pa…
Browse files Browse the repository at this point in the history
…th inlineable
  • Loading branch information
franz1981 committed Dec 8, 2023
1 parent 87eb294 commit b47f1fe
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
4 changes: 4 additions & 0 deletions independent-projects/resteasy-reactive/server/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
<groupId>io.quarkus.resteasy.reactive</groupId>
<artifactId>resteasy-reactive-common</artifactId>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-core</artifactId>
</dependency>
<dependency>
<groupId>jakarta.enterprise</groupId>
<artifactId>jakarta.enterprise.cdi-api</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.jboss.resteasy.reactive.server.core;

import static io.vertx.core.http.HttpHeaders.createOptimized;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
Expand Down Expand Up @@ -82,9 +84,10 @@ public void accept(ResteasyReactiveRequestContext context) {
private static final String CONTENT_LOWER = "content";
private static final String TYPE = "Type";
private static final String TYPE_LOWER = "type";
private static final String LENGTH = "Length";
private static final String LENGTH_LOWER = "length";
private static final String CONTENT_TYPE = CONTENT + "-" + TYPE; // use this instead of the Vert.x constant because the TCK expects upper case

// use this instead of the Vert.x constant because the TCK expects upper case
private static final CharSequence CONTENT_TYPE = createOptimized(CONTENT + "-" + TYPE);

static {
primitivesToWrappers.put(boolean.class, Boolean.class);
Expand Down Expand Up @@ -500,6 +503,11 @@ public static void encodeResponseHeaders(ResteasyReactiveRequestContext requestC
}
return;
}
encodeExistingResponseHeaders(requestContext, vertxResponse);
}

private static void encodeExistingResponseHeaders(ResteasyReactiveRequestContext requestContext,
ServerHttpResponse vertxResponse) {
Response response = requestContext.getResponse().get();
vertxResponse.setStatusCode(response.getStatus());

Expand Down

0 comments on commit b47f1fe

Please sign in to comment.