vertx-web
vertx-web copied to clipboard
WebClientBase request method does not populate headers from RequestOptions
Version
Validated it occurs 3.7.1
, 4.0.0
Context
When using request RequestOptions
WebClient client = WebClient.create(vertx);
client.request(HttpMethod.GET, new RequestOptions().addHeader("authorization", "Bearer: 4gse4kgsel")); // + URL etc.
The request does not contain the headers from RequestOptions.
Do you have a reproducer?
See the code above.
- Link to github project/gist
Steps to reproduce
See the code above
Extra
Windows 10, JDK1.8.0_202
I'd like to add that the same behavior is observed while using the WebClientSession, due to the same bug.
var webClient = WebClient.create(vertx);
var webClientSession = WebClientSession.create(webClient)
.addHeader("Authorization", "Bearer: 4gse4kgsel")
// No 'Authorization' header is being sent to server, just the 'User-Agent'
var request = webClientSession
.getAbs("http://example.com/api/v1/someEndpoint")
.send()