hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: HTTP specification problem: DefaultResponseParser
Date Sat, 21 Apr 2012 18:54:39 GMT
On Sat, 2012-04-21 at 21:32 +0300, Ivan Vaskevych wrote:
> Thanks mate!
> 
> Yeah, I already overridden the parseStatus and it works for me. I'm just
> curious, why browsers are ok with no status.
> Would be a good idea to implement this, at least through some conf
> parameter.
> 
> Cya and thanks for HC!
> 

Browser do a lot of stupid things in order to maximize compatibility
with all those broken CGI scripts out there. HttpClient is not a browser
so we ought not sink as low.

Usually Httpclient supports lenient behavior in those situations where
the spec is too vague or ambiguous, which is not the case in this
particular situation. As far as configuration parameters go HttpClient
already suffers from overuse (or abuse) of config parameters. People
should get used to the concept of having to write some code in order to
adapt HttpClient to their specific application contexts.

Cheers

Oleg  

>  Ivan
> 
> On Sat, Apr 21, 2012 at 9:10 PM, Oleg Kalnichevski <olegk@apache.org> wrote:
> 
> > On Sat, 2012-04-21 at 17:00 +0300, Ivan Vaskevych wrote:
> > > Hi folks,
> > >
> > >
> > > httpclient: 4.1.3
> > > httpcore: 4.1.4
> > >
> > > I get a response from the http server with empty status, and get the
> > > ProtocolException from HC. The stack trace is below.
> > > The site is https. Browsers (IE, Firefox) open the page successfully.
> > > Checked with Fiddler, no status in the first line indeed, just
> > "HTTP/1.1",
> > > then goes LF-CR and "Date:...."
> > >
> > > The research shows that omitted status code in the response from the
> > server
> > > means it's 200 OK (http://www.ietf.org/rfc/rfc3875, p.23).
> > > Can you please check this?
> > >
> > > Thanks.
> > >
> >
> > Hi Ivan
> >
> > As far as I know the official document that specifies the HTTP protocol
> > is still RFC 2616 [1]. The protocol specification is quite clear as to
> > what constitutes a valid HTTP status line (see section 6.1)
> >
> > This, however, does not prevent you from using a custom, more lenient
> > response parser, as described here [2]
> >
> > Hope this helps
> >
> > Oleg
> >
> > [1] http://www.faqs.org/rfcs/rfc2616.html
> > [2]
> >
> > http://hc.apache.org/httpcomponents-client-ga/tutorial/html/advanced.html#d5e1341
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> > For additional commands, e-mail: dev-help@hc.apache.org
> >
> >
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Mime
View raw message