Skip to content

Commit

Permalink
Merge pull request #25945 from geoand/#25932
Browse files Browse the repository at this point in the history
Set content-type for Qute templates in RESTEasy Reactive
  • Loading branch information
gsmet authored Jun 9, 2022
2 parents 2c09951 + 2eb715f commit be85007
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 be85007

Please sign in to comment.