vertx 3 - invalid escape sequence

338 views
Skip to first unread message

Jazz

unread,
Jun 10, 2015, 3:15:52 AM6/10/15
to ve...@googlegroups.com

Hi,

I am sending a application/x-www-form-urlencoded query paramters, but I get "invalid escape sequence".
The URLDecoder.decode(input, "UTF-8"); works just fine on the server when I pass the encoded string below, so I am sure there is something wrong with how the decoding is handled.

original string: qqq%vvv
encoded and sent to server as: qqq%25vvv
expected result:
qqq%vvv


Jun 10, 2015 3:01:23 AM io.vertx.ext.web.impl.RoutingContextImplBase
SEVERE
: Unexpected exception in route
java
.lang.IllegalArgumentException: invalid escape sequence `%vv' at index 3 of: qqq%vvv
    at io.netty.handler.codec.http.QueryStringDecoder.decodeComponent(QueryStringDecoder.java:352)
    at io.vertx.core.http.impl.HttpServerRequestImpl.urlDecode(HttpServerRequestImpl.java:596)
    at io.vertx.core.http.impl.HttpServerRequestImpl.handleEnd(HttpServerRequestImpl.java:353)
    at io.vertx.core.http.impl.ServerConnection.handleEnd(ServerConnection.java:285)
    at io.vertx.core.http.impl.ServerConnection.processMessage(ServerConnection.java:388)
    at io.vertx.core.http.impl.ServerConnection.handleMessage(ServerConnection.java:140)
    at io.vertx.core.http.impl.HttpServerImpl$ServerHandler.doMessageReceived(HttpServerImpl.java:532)
    at io.vertx.core.http.impl.HttpServerImpl$ServerHandler.doMessageReceived(HttpServerImpl.java:423)
    at io.vertx.core.http.impl.VertxHttpHandler.lambda$channelRead$7(VertxHttpHandler.java:71)
    at io.vertx.core.http.impl.VertxHttpHandler$$Lambda$38/435178405.run(Unknown Source)
    at io.vertx.core.impl.ContextImpl.lambda$wrapTask$5(ContextImpl.java:310)
    at io.vertx.core.impl.ContextImpl$$Lambda$4/674019271.run(Unknown Source)
    at io.vertx.core.impl.ContextImpl.executeFromIO(ContextImpl.java:204)
    at io.vertx.core.http.impl.VertxHttpHandler.channelRead(VertxHttpHandler.java:71)
    at io.vertx.core.net.impl.VertxHandler.channelRead(VertxHandler.java:131)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294)
    at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:254)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294)
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:182)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294)
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:846)
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:130)
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354)
    at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116)
    at java.lang.Thread.run(Thread.java:745)

 

I found a related post too:
https://groups.google.com/forum/#!searchin/vertx/invalid$20escape$20sequence/vertx/wZ6JKD5Mpec/IZQa-Ju831EJ

which has this github fix, that was merged then later deleted, not sure why.

https://github.com/eclipse/vert.x/pull/841




Tarek

unread,
Jun 10, 2015, 6:03:54 AM6/10/15
to ve...@googlegroups.com
Hi, 

there are some decoding tests in the io.vertx.test.core.HttpTest class. Do you have an example of your code?

Alexander Lehmann

unread,
Jun 10, 2015, 6:36:48 AM6/10/15
to ve...@googlegroups.com
The branch for the pull request was deleted after merge, that is the usual process when the merge is finished (in fact Github suggests that).

it looks like the fix was for vertx 2 at that time, maybe a similar issue is happening in vertx 3 as well (which should be easy to reproduce in a unit test)
Reply all
Reply to author
Forward
0 new messages