cURL / Mailing Lists / curl-library / Single Mail

curl-library

default HTML header Accept: image/...

From: Giuseppe Attardi <attardi_at_di.unipi.it>
Date: Tue, 23 Dec 2003 10:30:49 +0100

I noticed that in http.c a default Accept header
is added:

    Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*

Does it make sense to add it by default?
It almost doubles the size of a GET, and this is bad
if you want to handle billions of requests.
Moreover it sounds unlikely that the default use for cURL
is to transfer images.

I know I could remove it by passing an empty user header
with CURLOPT_HTTPHEADER, but that requires
allocating each time an slist, duplicating the header,
and deallocating it afterwards.

I would suggest just to drop the lines:

  if(!checkheaders(data, "Accept:"))
    http->p_accept = "Accept: image/gif, image/x-xbitmap, image/jpeg,
image/pjpeg, */*\r\n";

-- Beppe

-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
Free Linux Tutorials. Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
Received on 2003-12-23