Skip to content
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

jersey-netty-connector v2.40 is preserving Authorization header on a redirect #5414

Closed
sxsubram opened this issue Sep 13, 2023 · 0 comments · Fixed by #5423
Closed

jersey-netty-connector v2.40 is preserving Authorization header on a redirect #5414

sxsubram opened this issue Sep 13, 2023 · 0 comments · Fixed by #5423

Comments

@sxsubram
Copy link

sxsubram commented Sep 13, 2023

https://httpwg.org/specs/rfc9110.html#status.3xx -
When automatically following a redirected request, the user agent SHOULD resend the original request message with the following modifications:

Replace the target URI with the URI referenced by the redirection response's [Location](https://httpwg.org/specs/rfc9110.html#field.location) header field value after resolving it relative to the original request's target URI.

Remove header fields that were automatically generated by the implementation, replacing them with updated values as appropriate to the new request. This includes:
Connection-specific header fields (see Section 7.6.1),
Header fields specific to the client's proxy configuration, including (but not limited to)
Proxy-Authorization,
Origin-specific header fields (if any), including (but not limited to)
Host,
Validating header fields that were added by the implementation's cache (e.g.,
If-None-Match,
If-Modified-Since), and
Resource-specific header fields, including (but not limited to)
Referer,
Origin,
Authorization,
and Cookie.

In v2.40 I see that the original jersey request is used with just a change to the URI causing the original Authorization header to be resent.

Logs from my test

Initial request
POST /ic/api/integration/v1/archive HTTP/1.1
Authorization: userwelcome1
User-Agent: oracle-cloud-rest/23.3.1
Content-Type: multipart/form-data;boundary=Boundary_21_715846865_1694630297154
Accept-Encoding: gzip
host:
transfer-encoding: chunked

DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)
HTTP/1.1 302 Found
location: https:///ic/api/integration/v1/postFinal
access-control-allow-origin: *
...
}

nioEventLoopGroup-22-10 ts = 1694630298219 writeAndFlush(nettyRequest) - DefaultHttpRequest(decodeResult: success, version: HTTP/1.1)
POST /ic/api/integration/v1/postFinal HTTP/1.1
Authorization: userwelcome1
User-Agent: oracle-cloud-rest/23.3.1
Content-Type: multipart/form-data;boundary=Boundary_21_715846865_1694630297154
Accept-Encoding: gzip
MIME-Version: 1.0
host:
transfer-encoding: chunked

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

Successfully merging a pull request may close this issue.

1 participant