[erlang-questions] httpc sending empty te header

Ingela Andin <>
Tue Apr 6 09:06:50 CEST 2010


2010/4/1 Vincent de Phily <>:
> On Thursday 01 April 2010 08:56:29 Ingela Andin wrote:
>> From HTTP rfc:  "If the TE field-value is empty or if no TE field is
>> present, the only transfer-coding is "chunked""
> Fair enough, that explains why the behaviour is not wrong. But in that case,
> why add the header at all ? You'd save yourself two lines of code, a tiny bit
> of CPU, 5 bytes on the wire, and some confused users.

Well as it is legacy code I can only guess as to the reason why,  and my guess
would acctualy be clarity, e.i. by explicitly sending the empty te-header
stating that we only want to handle chunked transfer-encoding and it
is intentional.
Kind of like settig a default value explicitly for clarity.  I think
that clarity in the
code could be achived also with a comment and the minimalistic approch.
Maybe it would be better from a user perspective as it would not requier that
they understand the te-header. Something for us to think about.

Regards Ingela Erlang/OTP team Ericsson

More information about the erlang-questions mailing list