[erlang-questions] What lib to use for http requests

Loïc Hoguin essen@REDACTED
Mon Dec 15 21:00:25 CET 2014

On 12/15/2014 08:45 PM, Fred Hebert wrote:
> On 12/15, Loïc Hoguin wrote:
>> The RFC723x ones are much better though, they don't leave much room for
>> interpretation (though some things are still undefined) so implementations
>> following them should be much more compatible.
> Yes and no. Some features, like dropping support for Header
> line-folding, could mean that if you religiously implemented HTTP/1.1
> RFCs before RFCs 723x, you may suddenly find other HTTP/1.1 servers (who
> also respect their spec, though a newer one) explode on you.

Well this particular syntax is simply obsoleted by the RFC, you can 
still implement it. The reason it has been made obsolete is also worth 
reading as it's basically to prevent security issues so this would be 
the kind of thing you would want to use with proper consideration.

In Cowboy 2 this will most likely end up as a syntax disabled by default 
that you can enable through configuration (because, hey, we have the 
code already in after all).

> Intuitively, the issue is that HTTP/1.1 has had 3 revisions (or more)
> without a single version number change.

My point was strictly concerning RFC723x implementations, and is that 
RFC723x compliant implementations have a lot more chances of being 
compatible with each other, than RFC2616 compliant implementations would 
have with each other.

Of course there's a little of me that's being hopeful that in a couple 
years we can just forget about the bad dream that RFC2616 was, despite 
us never getting rid of it completely ever.

> If I want to have a truly flexible client, server, or proxy, I likely
> have to disregard that section of the new RFCs and keep implementing the
> old stuff, at least until the point where people start sending more
> garbage headers preceded by whitespace in practice, to the extent
> Postel's law dictates I should now switch over and pander to currently
> broken clients and servers rather than previously strict and correct
> ones.

 From what I read, if you follow RFC723x, including all the obsolete 
stuff, you should have no compatibility problem with RFC2616. In 
particular RFC723x comes with an "obsolete whitespace" and "obsolete 
text" that is input that should always be parsed but never generated. 
The only breaking changes I've seen so far concern a handful of headers 
that were either broken in the wild (everyone doing them wrong, 
basically) or that had some elements that were not used (so it shouldn't 
break anything if you parse them the new way, but probably will).

Loïc Hoguin

More information about the erlang-questions mailing list