Forum

/ Home \ \ Subjects /



Subject: HTTP protocol standard compliance

20/11/2008 17:22 ravenex:
shttp 3.05.83 win32 in proxy mode yields responses like
"HTTP/1.0 400\r\nContent-Type: text/html\r\n\r\n<hr><pre>...

This behavior violates RFC2616 in tools.ietf.org/html/rfc2616#sect ..
which states that Status-Line = HTTP-Version SP Status-Code SP Reason-Phrase CRLF
Reason Phrase is required here.

Also it respond with code 400 when it fails to connect to destination.
Bad request response is misleading, since request itself is ok.
404 or 502 seem to be more appropriate in this case.
20/11/2008 20:28 Max:
RFC it is recommendation. We must accept it, and use it for compatible between the programs, but we can think, when we use it.
Status-Line is technical part of reply. The human (user) never look at it.
Usually the proxy server don't know real reason of error. Probably the user enter wrong URL, bad name of domain, etc... May be it is hardware or wire error. Proxy server don't analyses it, and usually it can't detect real reason.
Server return 400, because it is most common code, and server don't return Reason-Phrase because it is useless data.
You can see, the browsers work fine without Reason-Phrase.

21/11/2008 15:10 ravenex:
The problem is, humans are not the only ones, who look at replies.
If it's a proxy server, any HTTP proxy capable program can use it to CONNECT to its destination. In this case error codes are useful for error analysis and recovery. And they can expect Reason-Phrase, since it's part of the protocol. In fact, the HTML body with error message itself may be useless to the program, because it may have no ability to render and display it.

I'm not really eager to fix (break) my code to make it work with shttp, so i switched to privoxy for testing purposes.
Alright then, and I hope shttp will get better some day.
23/11/2008 00:36 Max:
Thank you for your messages.
In version 3.05.84 the response fixed, Reason-Phrase has been added. Now this version available for testing.


User: Password: New user:   Save password: