Closed rmartinc closed 6 months ago
I have asked also about the authority
and absoluteURI
discrepancy in the vert.x google groups: https://groups.google.com/g/vertx/c/OBffuFH-WZU
in vertx 4.5.8 vertx-web will refuse HTTP requests without an host header since those are not valid according to HTTP
Version
4.5.7 but it's in master too.
Context
There is very weird behavior in
HttpServerrequest
between vert.x and vertx-web. In vert.x when the host header is missing it returnsnull
forauthority()
but returns an URI inabsoluteURI()
. Project vert.x executes some code to return the absolute URI based on the server origin. Nevertheless vertx-web returnsnull
in both methods. Reading the javadoc for HttpServerRequest I think thatauthority
can be null butabsoluteURI
not. I'm not happy with this because I don't understand thatabsoluteURI
has an authority filled but the specificauthority
method returns null, but OK, I accept it. But then can vertx-web do the same?I added this little diff to do the same in vertx-web too. I'm assigning initially the aboluteURI to the one returned by vert.x and modifying the
testMissingHostHeader
to assert is not null.Do you have a reproducer?
You can execute your own test
ForwardedTest#testMissingHostHeader
you will see thatauthority()
is null (as in vert.x) butabsolutyURI()
is also null (while in vert.x ishttp://localhost:8080/
).