cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: Adding empty HTTP Headers to curl requests?

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 27 Jan 2006 14:12:56 +0100 (CET)

On Fri, 27 Jan 2006, Cyrill Osterwalder wrote:

>> Yes, but the existing implemenation treat both these strings the same, and
>> thus I fear that changing the behaviour for any of these will break a lot
>> of programs and scripts out there...
>
> I definitely agree that a quick-fix might break existing libcurl
> applications. In the long run I guess libcurl should start to support empty
> headers at some point.

Indeed. The question is just in what way we add support for it while in the
mean time break as few existing applications as possible.

> The best approach I have so far is to supply a header with an empty value
> enclosed in double quotes:
>
> EmptyHeader: ""
>
> This header should be RFC conform and supposedly fulfills the requirement of
> an empty header.
>
> Any thoughts or suggestions about this approach? It works with libcurl.

Ah, that's a neat approach that I'll make sure to document as working right
now. Great!

The only problem with this method that I can think of right now, is that there
will most probably show up one or two server-end applications that don't
adhere to the RFC properly and they'll go bananas when the blank header uses
"" when it expected nothing...

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2006-01-27