#57089·quarkus

OIDC protected resource metadata response has no Content-Type

Author: kerner1000Created Oct 1, 2026Updated Oct 1, 2026
Labelsarea/oidc

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:

https://github.com/quarkusio/quarkus/blob/3.38.2/extensions/oidc/runtime/src/main/java/io/quarkus/oidc/runtime/ResourceMetadataHandler.java#L136-L141

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?

  1. Create an application with quarkus-oidc and set quarkus.oidc.resource-metadata.enabled=true (plus an auth-server-url).
  2. Run it and request the metadata: curl -si http://localhost:8080/.well-known/oauth-protected-resource
  3. The response is 200 with a JSON body and no Content-Type header.

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(...).