-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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 and security: invalid response after challenge and exception mapper, two Location
headers
#38523
Comments
/cc @geoand (resteasy-reactive), @sberyozkin (security), @stuartwdouglas (resteasy-reactive) |
Hi @FroMage Where is the Location header set in Quarkus, which code set its value to
It does appear to be the right thing to do |
|
@FroMage Sorry, yes, you mentioned it, I wonder why are header values different, looks like some authentication mechanism (which one ?) and the custom exception mapper use different Location header value calculation... Just curious if there is something in Quarkus that may need to be tuned... |
That's not really the point, the issue is that RESTEasy Reactive should overwrite any header already set in the vert.x response, when it maps the JAX-RS |
I agree, although I do have a fear that we've faced the inverse problem in the past and hence the current behavior |
If that's the case, I pray we added a test for the behaviour, which we'll break and find the issue we wanted to fix with this behaviour. Then discuss this further :) |
Yeah, I have to check |
Only allow a single Location to be set in RESTEasy Reactive
I'm getting an auth challenge from
HttpAuthenticationMechanism.ChallengeSender
which sets the response code and adds aLocation
header directly to the Vert.x response, and then anAuthenticationFailedException
is thrown, resulting in my@ServerExceptionMapper
being called and also setting aLocation
by returning aResponse.seeOther()
and we end up with twoLocation
headers:I suspect that at the very least, any
Response
data set by the exception mapper should override the ones set previously, if only because theResponse
is not meant to come on top of anything prior to it, but override it from scratch. So, the exception mapper'sLocation
should "win" and override the security challenge one.I wonder what other headers are set directly on the Vert.x response, before we translate the
Response
headers onto it?This was first reported in quarkiverse/quarkus-renarde#194
The text was updated successfully, but these errors were encountered: