Hi all,

Le 21/09/2012 21:11, Cyril Bonté a écrit :
Le 21/09/2012 20:59, Baptiste a écrit :
HAProxy clearly says that the error is at position 23, which looks to
be a P, but I guess this is due to the copy/paste.
A tcpdump may help understanding what type of character is at this
position.

That said, sounds weird that it works with HAProxy 1.4 and does not
anymore with 1.5-dev12.

Not really, allowed characters have changed from haproxy 1.4 to 1.5.
This is detailed in "option accept-invalid-http-request"
http://cbonte.github.com/haproxy-dconv/configuration-1.5.html#option%20accept-invalid-http-request

To complete the answer, Baptiste was right when asking to give a try to haproxy-1.5-dev7, because the patch was applied between dev7 and dev8 :
http://haproxy.1wt.eu/git?p=haproxy.git;a=commit;h=422246eb265bc0cfebb5c872ba3d4289798f9cd3

And Willy added some documentation about that (with a note about Apache allowing non-ascii characters) :
http://haproxy.1wt.eu/git?p=haproxy.git;a=commit;h=2f1feb99a5499510183f398730cddc2a7e7df863

So, it looks like the only alternative is to add "option accept-invalid-http-request" in your frontend configuration.

Btw, Willy I noticed 2 weird things :
- haproxy doesn't compile anymore when DEBUG_FULL is used, I'll send the patch in a few minutes.
- Using "-d" option on the command line gives weird results :

For the test, I call a first request with a non-ascii character, then a valid request, then the first request again.
What we can observe is that :
- the first request gives an empty clireq line
- the valid one is OK
- then, the third (invalid) request has an non empty clireq line.

00000001:s.accept(0003)=0006 from [127.0.0.1:33748]
00000001:s.clireq[0006:ffff]:
00000001:s.clicls[0006:ffff]
00000001:s.closed[0006:ffff]
00000002:s.accept(0003)=0006 from [127.0.0.1:33750]
00000002:s.clireq[0006:ffff]: GET /test HTTP/1.1
00000002:s.clihdr[0006:ffff]: User-Agent: curl/7.27.0
00000002:s.clihdr[0006:ffff]: Host: localhost:4000
00000002:s.clihdr[0006:ffff]: Accept: */*
00000002:s.clicls[0006:ffff]
00000002:s.closed[0006:ffff]
00000003:s.accept(0003)=0006 from [127.0.0.1:33752]
00000003:s.clireq[0006:ffff]: GET /ééééé HT
00000003:s.clicls[0006:ffff]
00000003:s.closed[0006:ffff]


--
Cyril Bonté

Reply via email to