-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Resteasy Reactive not working with unspecified accept header and multiple produces #18997
Comments
/cc @FroMage, @geoand, @stuartwdouglas |
I see the same issue with RESTEasy Classic, so I am inclined to think it's just how the JAX-RS spec handles these cases. WDYT @FroMage ? |
But this used to work for me in resteasy classic in quarkus 1.10, so i dont think its normal behavior. |
I just switched your reproducer to resteasy classic and the tests still failed |
Sorry, i had an error in the test assertion, which also failed by mistake in resteasy-classic but not due to the same problem:
should be:
EDIT: Sorry i accidently swapped the quoted code |
Here is the the test with resteasy-classic with fixed assertion that is not failing: Here with resteasy-reactive failing with fixed assertion: |
The workaround is to use |
It does seem like RESTEasy Reactive is not using the same default as RESTEasy Classic though... I'll have a look |
Thanks for looking into it. |
This is meant to better implement point 5 of part 3.8 of the spec that mentions: ``` For each member of P, p: – If a is compatible with p, add S(a, p) to M , where the function S returns the most specific media type of the pair with the q-value of a and server-side qs-value of p. ``` Now, what I have done here might not be the complete solution, I would indeed like to proceed with caution on this (and this only fixed the case reported) as the media type handling is fraught with a lot of corner cases... Fixes: quarkusio#18997
#19000 should fix the issue |
As i can see the quality factor (qs parameter) is not yet considered in this fix? |
It is because the supported media types are sorted by qs |
Thanks for clarifing this! |
Make media type negotiation in RESTEasy Reactive more spec compliant
This is meant to better implement point 5 of part 3.8 of the spec that mentions: ``` For each member of P, p: – If a is compatible with p, add S(a, p) to M , where the function S returns the most specific media type of the pair with the q-value of a and server-side qs-value of p. ``` Now, what I have done here might not be the complete solution, I would indeed like to proceed with caution on this (and this only fixed the case reported) as the media type handling is fraught with a lot of corner cases... Fixes: quarkusio#18997 (cherry picked from commit 5d4f4bd)
Describe the bug
I have discovered a problem with resteasy-reactive and produces media type matching.
If i have more than one media type (e.g. text/plain and application/json) and no specific mediatype is selected in the accept header, then the response contains content-type: application/octet-stream.
Also i noticed that the qs parameter is ignored in resteasy-reactive, which is unfortunatly very important in our projekt.
This is in quarkus 2.0.3.Final.
I added an repoducer:
reproducer.zip
Just execute the test.
The text was updated successfully, but these errors were encountered: