Skip to content

Commit

Permalink
Set content-type for Qute templates in RESTEasy Reactive
Browse files Browse the repository at this point in the history
  • Loading branch information
geoand committed Jun 3, 2022
1 parent 07ddfcb commit 2eb715f
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import static io.quarkus.resteasy.reactive.qute.runtime.Util.*;
import static io.quarkus.resteasy.reactive.qute.runtime.Util.toUni;

import javax.ws.rs.core.MediaType;

import org.jboss.resteasy.reactive.server.core.ResteasyReactiveRequestContext;
import org.jboss.resteasy.reactive.server.spi.ServerRestHandler;

Expand Down Expand Up @@ -33,8 +35,9 @@ public void handle(ResteasyReactiveRequestContext requestContext) {
}

private Uni<String> createUni(ResteasyReactiveRequestContext requestContext, TemplateInstance result, Engine engine) {
setSelectedVariant(result, requestContext.getRequest(),
MediaType mediaType = setSelectedVariant(result, requestContext.getRequest(),
requestContext.getHttpHeaders().getAcceptableLanguages());
requestContext.setResponseContentType(mediaType);
return toUni(result, engine);
}

Expand Down

0 comments on commit 2eb715f

Please sign in to comment.