[ 
https://issues.apache.org/jira/browse/CAMEL-13707?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16878205#comment-16878205
 ] 

Jan Bednar edited comment on CAMEL-13707 at 7/3/19 10:35 PM:
-------------------------------------------------------------

It seems to be issue in netty producer. When *CamelHttpQuery* is null or single 
slash, it goes removed from request uri. Some webservers then treats the 
request as invalid in combination with http query parameters. I was able to 
reproduce this in 3.0.0.M3  with simple producer [^CamelHttpQuerySlashPath.java]

Wireshark shows this:
{code:java}
Request:

GET ?hello=hi HTTP/1.1
User-Agent: curl/7.47.0
Accept: */*
Proxy-Connection: Keep-Alive
content-length: 0
Accept: */*
hello: hi
User-Agent: curl/7.47.0
host: captive.apple.com
connection: keep-alive

Response:
HTTP/1.0 400 Invalid HTTP Request
Date: Wed, 03 Jul 2019 21:18:28 GMT
Via: http/1.1 deber5-edge-bx-009.ts.apple.com (ApacheTrafficServer/8.0.4)
Server: ATS/8.0.4
Cache-Control: no-store
Content-Type: text/html
Content-Language: en
CDNUUID: cd74be3a-730d-46eb-a5e8-29e9da0816f4-1791644171
Content-Length: 219

<HTML>
<HEAD>
<TITLE>Bad Request</TITLE>
</HEAD>

<BODY BGCOLOR="white" FGCOLOR="black">
<H1>Bad Request</H1>
<HR>

<FONT FACE="Helvetica,Arial"><B>
Description: Could not process this request.
</B></FONT>
<HR>
</BODY>

{code}
 


was (Author: bedla):
It seems to be issue in netty producer. When *CamelHttpQuery* is null or single 
slash, it goes removed from request uri. Some webservers then treats the 
request as invalid. I was able to reproduce this in 3.0.0.M3  with simple 
producer [^CamelHttpQuerySlashPath.java]

Wireshark shows this:
{code:java}
Request:

GET ?hello=hi HTTP/1.1
User-Agent: curl/7.47.0
Accept: */*
Proxy-Connection: Keep-Alive
content-length: 0
Accept: */*
hello: hi
User-Agent: curl/7.47.0
host: captive.apple.com
connection: keep-alive

Response:
HTTP/1.0 400 Invalid HTTP Request
Date: Wed, 03 Jul 2019 21:18:28 GMT
Via: http/1.1 deber5-edge-bx-009.ts.apple.com (ApacheTrafficServer/8.0.4)
Server: ATS/8.0.4
Cache-Control: no-store
Content-Type: text/html
Content-Language: en
CDNUUID: cd74be3a-730d-46eb-a5e8-29e9da0816f4-1791644171
Content-Length: 219

<HTML>
<HEAD>
<TITLE>Bad Request</TITLE>
</HEAD>

<BODY BGCOLOR="white" FGCOLOR="black">
<H1>Bad Request</H1>
<HR>

<FONT FACE="Helvetica,Arial"><B>
Description: Could not process this request.
</B></FONT>
<HR>
</BODY>

{code}
 

> Query string issues
> -------------------
>
>                 Key: CAMEL-13707
>                 URL: https://issues.apache.org/jira/browse/CAMEL-13707
>             Project: Camel
>          Issue Type: Bug
>            Reporter: Eloy Coto
>            Priority: Minor
>         Attachments: CamelHttpQuerySlashPath.java
>
>
> Test environment:
>  
> [https://github.com/zregvart/camel-netty-proxy]
> running the readme, all ok,
>  
> running the following command, no connection and the following error message: 
> {code:java}
> $ http_proxy=http://localhost:8080 curl -v "http://neverssl.co?user=123m"; * 
> Uses proxy env variable http_proxy == 'http://localhost:8080' * Trying ::1... 
> * TCP_NODELAY set * Connected to localhost (::1) port 8080 (#0) > GET 
> http://neverssl.co/?user=123m HTTP/1.1 > Host: neverssl.co > User-Agent: 
> curl/7.64.0 > Accept: */* > Proxy-Connection: Keep-Alive > ^C {code}
> Log output:
> {code:java}
> 2019-07-01 08:23:55 [Camel Thread #11 - NettyClientTCPWorker] WARN 
> i.n.util.concurrent.DefaultPromise - An exception was thrown by 
> org.apache.camel.component.netty4.NettyProducer$ChannelConnectedListener.operationComplete()
>  io.netty.util.IllegalReferenceCountException: refCnt: 0, decrement: 1 at 
> io.netty.util.internal.ReferenceCountUpdater.toLiveRealRefCnt(ReferenceCountUpdater.java:74)
>  at 
> io.netty.util.internal.ReferenceCountUpdater.release(ReferenceCountUpdater.java:138)
>  at 
> io.netty.buffer.AbstractReferenceCountedByteBuf.release(AbstractReferenceCountedByteBuf.java:100)
>  at 
> io.netty.handler.codec.http.HttpObjectAggregator$AggregatedFullHttpMessage.release(HttpObjectAggregator.java:386)
>  at io.netty.util.ReferenceCountUtil.release(ReferenceCountUtil.java:88) at 
> org.apache.camel.component.netty4.NettyProducer$BodyReleaseCallback.done(NettyProducer.java:663)
>  at 
> org.apache.camel.component.netty4.NettyProducer$ChannelConnectedListener.operationComplete(NettyProducer.java:631)
>  at 
> org.apache.camel.component.netty4.NettyProducer$ChannelConnectedListener.operationComplete(NettyProducer.java:612)
>  at 
> io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:502)
>  at 
> io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:495)
>  at 
> io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:474)
>  at 
> io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:415)
>  at 
> io.netty.util.concurrent.DefaultPromise.setValue0(DefaultPromise.java:540) at 
> io.netty.util.concurrent.DefaultPromise.setFailure0(DefaultPromise.java:533) 
> at 
> io.netty.util.concurrent.DefaultPromise.setFailure(DefaultPromise.java:106) 
> at 
> io.netty.channel.DefaultChannelPromise.setFailure(DefaultChannelPromise.java:89)
>  at io.netty.bootstrap.Bootstrap.doResolveAndConnect0(Bootstrap.java:216) at 
> io.netty.bootstrap.Bootstrap.access$000(Bootstrap.java:49) at 
> io.netty.bootstrap.Bootstrap$1.operationComplete(Bootstrap.java:188) at 
> io.netty.bootstrap.Bootstrap$1.operationComplete(Bootstrap.java:174) at 
> io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:502)
>  at 
> io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:476)
>  at 
> io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:415)
>  at 
> io.netty.util.concurrent.DefaultPromise.setValue0(DefaultPromise.java:540) at 
> io.netty.util.concurrent.DefaultPromise.setSuccess0(DefaultPromise.java:529) 
> at 
> io.netty.util.concurrent.DefaultPromise.trySuccess(DefaultPromise.java:101) 
> at 
> io.netty.channel.DefaultChannelPromise.trySuccess(DefaultChannelPromise.java:84)
>  at 
> io.netty.channel.AbstractChannel$AbstractUnsafe.safeSetSuccess(AbstractChannel.java:1009)
>  at 
> io.netty.channel.AbstractChannel$AbstractUnsafe.register0(AbstractChannel.java:517)
>  at 
> io.netty.channel.AbstractChannel$AbstractUnsafe.access$200(AbstractChannel.java:428)
>  at 
> io.netty.channel.AbstractChannel$AbstractUnsafe$1.run(AbstractChannel.java:487)
>  at 
> io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
>  at 
> io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:405)
>  at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500) at 
> io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:906)
>  at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) 
> at java.lang.Thread.run(Thread.java:748){code}
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to