cURL / Mailing Lists / curl-library / Single Mail

curl-library

Problem with the Accept header?

From: Pooyan McSporran <duckfreezone_at_gmail.com>
Date: Fri, 15 Feb 2008 16:16:27 +1030

I've got an application which does a POST with default headers, and
then another POST but this time setting some headers to non-default
values. One of these is the Accept: header, specifying a different
value for that header.

If I look at a capture of the HTTP traffic, on the first POST, I can
see the default "Accept: */*" header & value, but on the second one I
again get "Accept: */*" as well as my custom value for Accept; ie, we
get the Accept header twice.

I'm not very familiar with the innards of libcurl, but it appears that
libcurl does check to see if the user has specified a custom Accept
header, and if one is not specified then the default value is used.
This is fine in itself, but if we then later do a subsequent request
but with a custom Accept header then this default value is not cleared
(ie, the code should set http->p_accept to NULL in this scenario).
See http.c:2186 in current CVS.

I've tested this theory and it fixes my problem, but as I'm new to
libcurl I'm not sure if this is an actual bug or simply that I'm
mis-using the library.
Received on 2008-02-15