OIDC protected resource metadata response has no Content-Type
Describe the bug
With quarkus.oidc.resource-metadata.enabled=true, the OAuth 2.0 Protected Resource Metadata response served at /.well-known/oauth-protected-resource[/<resource>] has no Content-Type header. RFC 9728 §3.2 requires application/json.
ResourceMetadataHandler.RouteHandler.handle sets the status and ends the response with the JSON string, but sets no header:
The same code is unchanged on 4.0.0.Beta1 and main.
Expected behavior
Content-Type: application/json on the metadata response.
Actual behavior
No Content-Type header. A RestAssured check in our application reports Expected content-type "application/json" doesn't match actual content-type "".
How to Reproduce?
- Create an application with
quarkus-oidcand setquarkus.oidc.resource-metadata.enabled=true(plus anauth-server-url). - Run it and request the metadata:
curl -si http://localhost:8080/.well-known/oauth-protected-resource - The response is
200with a JSON body and noContent-Typeheader.
Output of uname -a or ver
Darwin 25.6.0
Output of java -version
openjdk version "21.0.9" 2025-10-21
Quarkus version or git rev
3.38.2 (source unchanged on 4.0.0.Beta1 and main)
Build tool (ie. output of mvnw --version or gradlew --version)
Apache Maven 3.9.12
Additional information
We work around it with a Vert.x route at order(-1000) on the metadata path that calls putHeader(HttpHeaders.CONTENT_TYPE, "application/json") and then context.next(). The likely fix is to set that header in RouteHandler.handle before end(...).
Source: quarkusio/quarkus