Skip to content

Conversation

@geoand
Copy link
Contributor

@geoand geoand commented Nov 18, 2025

@geoand geoand changed the title Resteasy Reactive: preserve Accept header order on ties (fixes #51077) Preserve Accept header order in Quarkus REST Nov 18, 2025
@geoand geoand force-pushed the fix/rr-accept-order-51077 branch from bf2fdd2 to 29a42d2 Compare November 18, 2025 14:30
geoand added a commit to geoand/quarkus that referenced this pull request Nov 18, 2025
@geoand geoand force-pushed the fix/rr-accept-order-51077 branch from 29a42d2 to e51e83c Compare November 18, 2025 14:36
@geoand
Copy link
Contributor Author

geoand commented Nov 18, 2025

This fails the TCK with:

2025-11-18T16:35:18.9545649Z [ERROR] Failures: 
2025-11-18T16:35:18.9547688Z [ERROR]   JAXRSClient0138.getAcceptableMediaTypesIsSortedTest:195->invokeRequestAndCheckResponse:801->invokeRequestAndCheckResponse:812->JaxrsCommonClient.invoke:212 [WebValidatorBase] Unable to find the following search string in the server's response: 'text/html;q=0.7' at index: 17
2025-11-18T16:35:18.9549155Z [WebValidatorBase] Server's response:
2025-11-18T16:35:18.9549804Z -------------------------------------------
2025-11-18T16:35:18.9550268Z text/html;level=1 text/html */* text/html;level=2 text/* ;GETACCEPTABLEMEDIATYPES
2025-11-18T16:35:18.9550723Z -------------------------------------------

@geoand geoand force-pushed the fix/rr-accept-order-51077 branch from f75c03f to b13040b Compare November 19, 2025 07:00
@gsmet
Copy link
Member

gsmet commented Nov 20, 2025

Yes, from what I can see you are missing the duplicates.
The test is a bit dumb if you ask me but apparently you need to keep all of the options even if they are the same.

        setProperty(Property.REQUEST_HEADERS,
                "Accept: text/*;q=0.3, text/html;q=0.7, text/html;level=1,text/html;level=2;q=0.4, */*;q=0.5");
        setProperty(Property.SEARCH_STRING, "text/html;level=1");
        setProperty(Property.SEARCH_STRING, "text/html;q=0.7");
        setProperty(Property.SEARCH_STRING, "*/*;q=0.5");
        setProperty(Property.SEARCH_STRING, "text/html;level=2;q=0.4");
        setProperty(Property.SEARCH_STRING, "text/*;q=0.3");

@geoand
Copy link
Contributor Author

geoand commented Nov 20, 2025

Right. I'll pick up this stupid issue again next week :)

@geoand
Copy link
Contributor Author

geoand commented Nov 21, 2025

Just so I don't go searching for the failure again, here it is:

2025-11-19T07:26:15.1794784Z [ERROR] org.jboss.resteasy.reactive.server.vertx.test.resource.basic.AcceptHeaderOrderTest.preservesOrderOnTies
2025-11-19T07:26:15.1796860Z [ERROR]   Run 1: AcceptHeaderOrderTest.preservesOrderOnTies:45 expected: <application/json,text/html;charset=UTF-8,text/plain;charset=UTF-8,*/*> but was: <application/json,text/html;charset=UTF-8,text/plain;charset=UTF-8,*/*;q=0.8>
2025-11-19T07:26:15.1798963Z [ERROR]   Run 2: AcceptHeaderOrderTest.preservesOrderOnTies:45 expected: <application/json,text/html;charset=UTF-8,text/plain;charset=UTF-8,*/*> but was: <application/json,text/html;charset=UTF-8,text/plain;charset=UTF-8,*/*;q=0.8>
2025-11-19T07:26:15.1800413Z [ERROR]   Run 3: AcceptHeaderOrderTest.preservesOrderOnTies:45 expected: <application/json,text/html;charset=UTF-8,text/plain;charset=UTF-8,*/*> but was: <application/json,text/html;charset=UTF-8,text/plain;charset=UTF-8,*/*;q=0.8>
2025-11-19T07:26:15.1801807Z [ERROR]   Run 4: AcceptHeaderOrderTest.preservesOrderOnTies:45 expected: <application/json,text/html;charset=UTF-8,text/plain;charset=UTF-8,*/*> but was: <application/json,text/html;charset=UTF-8,text/plain;charset=UTF-8,*/*;q=0.8>

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.

Resteasy Reactive: httpHeaders.getAcceptableMediaTypes() return media types in wrong order

2 participants