-
Notifications
You must be signed in to change notification settings - Fork 38.1k
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
Expose headers from native client request after request is committed #27768
Expose headers from native client request after request is committed #27768
Conversation
03e76b0
to
104a18f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change might not be implemented in exactly this way. For example we don't use protected fields.
Rather than providing a solution, please update the description of the pull request in order to describe the actual problem, and not just reference some external issue which requires additional context.
@rstoyanchev Fair enough |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for elaborating.
We have a NettyHeadersAdapter
that's used to expose the underlying headers on the response. We can enable the same on the request side. So, rather than exposing all the protected fields, I would suggest a protected initReadOnlyHeaders
method that can be overridden in sub-classes. For Reactor Netty, it would be:
@Override
protected HttpHeaders initReadOnlyHeaders() {
return HttpHeaders.readOnlyHttpHeaders(new NettyHeadersAdapter(request.requestHeaders()));
}
Let me know if you plan to update the PR, or otherwise I'll take it from here.
104a18f
to
bdc5207
Compare
@rstoyanchev totally makes sense, I've reworked it according to your recommendations (netty, apache http 5, jetty). |
bdc5207
to
7f648e3
Compare
Fixes issues like that, when public API does not expose headers that have been set by connector implementation.