cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Double accept-header upon easy handle reuse

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 13 Aug 2008 10:55:26 +0200 (CEST)

On Tue, 12 Aug 2008, Gabriel Kälin wrote:

> When you create an easy handle, but don't set the Accept header yourself,
> libcurl adds an implicit Accept header. Now the problem arises, if for a
> subsequent request on the easy handle you try to set your custom Accept
> header, because the request will end with two Accept headers: Yours and the
> implicit one! Some servers don't like two accept headers at all, while it is
> confusing at best.

You didn't tell what libcurl version you're using, but I wrote up an example
that tried to mimic your description and it works just fine for me with my
current dev version. The code I used is now available here:

         http://curl.haxx.se/lxr/source/docs/examples/httpcustomheader.c

-- 
  / daniel.haxx.se
Received on 2008-08-13