vert-x3 / vertx-web

HTTP web applications for Vert.x
Apache License 2.0
1.11k stars 535 forks source link

Unhandled exception in router #2675

Open IBPrivate opened 1 week ago

IBPrivate commented 1 week ago

I do get more errors in the last time about "Unhandled exception in router".

I added logging:

router.route().failureHandler(routingContext -> {
    Throwable failure = routingContext.failure();
    if (failure != null) {
        failure.printStackTrace();
    } else {
        Server.log("A failue without throwable has occured:");
        Server.log("RequestURL: " + routingContext.request().absoluteURI());
        Server.log("Requested URL: " + routingContext.request().path());
        Server.log("HTTP-Method: " + routingContext.request().method());
        Server.log("Header: " + routingContext.request().headers());
        Server.log("Body: " + routingContext.body().asString());
        if (routingContext.request().authority() != null) {
            WebSK.log("Host: " +  routingContext.request().authority().host());
        }
    }
    routingContext.response().setStatusCode(404).end();
});

A failue without throwable has occured: RequestURL: http://example.com:443example.com:443 Requested URL: example.com:443 HTTP-Method: CONNECT Header: Host=example.com:443 User-Agent=Go-http-client/1.1 Body: null Host: http://example.com

Any ideas how to supress them (or correct this issue, its kind of annoying)...

IBPrivate commented 1 week ago

And why is routingContext.request().absoluteURI() doubled: "http://example.com:443example.com:443/"? Shouldn't that be "http://example.com:443"?

tsegismont commented 1 week ago

Perhaps it is the client that is not working well? Can you enable traffic logging or capture it with Wireshark?

IBPrivate commented 1 week ago

I cant reproduce that - I dont make the requests.