Skip to content

Quarkus REST - Be more forgiving when adding headers #47546

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gsmet
Copy link
Member

@gsmet gsmet commented Apr 25, 2025

The JAX-RS API is very loose and allows adding Object and in some cases we actually add a List to the headers and we need to take this into account.

While I'm usually not for handling things this way, the API is not enforcing things properly so I think we really need to handle this ourself and be more forgiving if a list is added.

Fixes #47507

The JAX-RS API is very loose and allows adding Object and in some cases
we actually add a List to the headers and we need to take this into
account.

While I'm usually not for handling things this way, the API is not
enforcing things properly so I think we really need to handle this
ourself.

Fixes quarkusio#47507
@gsmet gsmet requested a review from geoand April 25, 2025 07:37
@gsmet gsmet changed the title Quarkus REST - Be more permissive when adding headers Quarkus REST - Be more forgiving when adding headers Apr 25, 2025
Copy link

quarkus-bot bot commented Apr 25, 2025

Status for workflow Quarkus CI

This is the status report for running Quarkus CI on commit e7730ea.

Failing Jobs

Status Name Step Failures Logs Raw logs Build scan
✔️ JVM Integration Tests - JDK 17 Logs Raw logs 🔍
✔️ JVM Integration Tests - JDK 17 Windows Logs Raw logs 🔍
JVM Integration Tests - JDK 21 Build Failures Logs Raw logs 🔍

Full information is available in the Build summary check run.
You can consult the Develocity build scans.

Failures

⚙️ JVM Integration Tests - JDK 21 #

- Failing: integration-tests/compose-devservices 

📦 integration-tests/compose-devservices

io.quarkus.it.compose.devservices.HealthChecksTest.health line 16 - History - More details - Source on GitHub

java.net.SocketTimeoutException: Read timed out
	at java.base/sun.nio.ch.NioSocketImpl.timedRead(NioSocketImpl.java:278)
	at java.base/sun.nio.ch.NioSocketImpl.implRead(NioSocketImpl.java:304)
	at java.base/sun.nio.ch.NioSocketImpl.read(NioSocketImpl.java:346)
	at java.base/sun.nio.ch.NioSocketImpl$1.read(NioSocketImpl.java:796)
	at java.base/java.net.Socket$SocketInputStream.read(Socket.java:1099)
	at org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:161)
	at org.apache.http.impl.io.SocketInputBuffer.fillBuffer(SocketInputBuffer.java:82)

io.quarkus.it.compose.devservices.kafka.KafkaServiceTest.test line 17 - History - More details - Source on GitHub

java.lang.AssertionError: 
1 expectation failed.
Expected status code <204> but was <500>.

	at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:62)
	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:502)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:486)
	at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:73)

Flaky tests - Develocity

⚙️ JVM Integration Tests - JDK 21

📦 integration-tests/opentelemetry-grpc-only

io.quarkus.it.opentelemetry.grpc.HelloGrpcClientTest.testHello - History

  • java.lang.RuntimeException: Failed to start quarkus - java.lang.RuntimeException
java.lang.RuntimeException: java.lang.RuntimeException: Failed to start quarkus
	at io.quarkus.test.junit.QuarkusTestExtension.throwBootFailureException(QuarkusTestExtension.java:693)
	at io.quarkus.test.junit.QuarkusTestExtension.interceptTestClassConstructor(QuarkusTestExtension.java:791)
	at java.base/java.util.Optional.orElseGet(Optional.java:364)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
Caused by: java.lang.RuntimeException: Failed to start quarkus
	at io.quarkus.runner.ApplicationImpl.doStart(Unknown Source)

@geoand
Copy link
Contributor

geoand commented Apr 25, 2025

Thanks for taking care of this!

Can a test be added easily that reproduces the original problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HeaderHelper.getMediaType throws ClassCastException when Content-Type header is stored as a List
2 participants