vertx-web icon indicating copy to clipboard operation
vertx-web copied to clipboard

Unclear message when sending a bad request to the RoutingContext

Open BobClaerhout opened this issue 2 years ago • 0 comments

Version

vertx-web:4.3.4

Context

I was using an open source project (hono) and encountered following logging (most of it is redacted because it isn't helpful for my issue here:

loggerName: io.vertx.ext.web.RoutingContext message":"Route matches: RouteState{...}"
loggerName: io.vertx.ext.web.RoutingContext message":"Calling the  handler"
loggerName: io.vertx.ext.web.RoutingContext message":"RoutingContext failure (400)" exception":{"exceptionType":"io.vertx.ext.web.handler.HttpException","message":"Bad Request"}

As it turned out, after some debugging, I was sending faulty headers:

authorization: */*
accept: application/json, Basic ...

Mind the accept header here, it does contain a basic auth header while the auth header actually should be the accept header. This mix-up was a mistake due to a bug in our testing system. However, it was really hard to determine the exact issue since the routingContext only proviedes the message bad request. I was wondering whether it would be possible to provide a bit more context when the request is faulty.

Do you have a reproducer?

Just send a request with a faulty accept header.

BobClaerhout avatar Dec 08 '22 13:12 BobClaerhout