cURL / Mailing Lists / curl-library / Single Mail


default HTML header Accept: image/...

From: Giuseppe Attardi <>
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 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!
Received on 2003-12-23