Open wbkys opened 2 years ago
Occurs when an interface address is entered in the address bar
can you reproduce from curl ?
can you reproduce from curl ?
The problem occurs in the method rout.queryParam
io.vertx.ext.web.impl.RoutingContextImpl => private MultiMap getQueryParams(Charset charset) => io.netty.handler.codec.http.QueryStringDecoder => private static String decodeComponent(String s, int from, int toExcluded, Charset charset, boolean isPath) %Symbol judgment is too simple
Questions
An error will occur if the http request parameter contains %
Version
vertx-web-4.3.2 Which version(s) did you encounter this bug ?
Context
I encountered an exception which looks suspicious while ...
Do you have a reproducer?
A reproducer is a simple project hosted on GitHub (or another forge supporting git clone operation) that has a build file that can be executed to reproduce the issue.
Reproducers are very helpful for contributors and will likely help them fixing your bug faster.
Steps to reproduce
`public class MainVerticle extends AbstractVerticle {
@Override public void start(Promise startPromise) throws Exception {
Router router = Router.router(vertx);
router.get("/v1").handler(this::test);
vertx.createHttpServer().requestHandler(req -> {
req.response()
.putHeader("content-type", "text/plain")
.end("Hello from Vert.x!");
}).listen(8888, http -> {
if (http.succeeded()) {
startPromise.complete();
System.out.println("HTTP server started on port 8888");
} else {
startPromise.fail(http.cause());
}
});
}
private void test(RoutingContext rout) { String aa = rout.queryParam("t").isEmpty() ? null : rout.queryParam("t").get(0); } }`
get 127.0.0.1:8888/v1?t=a% echo error 400
Extra