cURL / Mailing Lists / curl-library / Single Mail

curl-library

Bypassing libcurl's handling of content-encoding and transfer-encoding

From: Shmulik Regev <shmulbox_at_gmail.com>
Date: Mon, 29 Jan 2007 12:45:09 +0200

Hi,

I'm using libcurl in the implementation of an HTTP proxy. In some scenarios
I want to forward to the client the raw data as was received from the
server. Libcurl however, tries to decode the responses it gets based on the
content-encoding and transfer-encoding headers. I would like to disable this
behavior. Disabling the content handling can be achieved by NOT setting the
CURLOPT_ENCODING option. However decoding chunked responses is automatic.
Possibly there are other cases in which the raw data is transformed by
libcurl. My question is, will it be possible to add a configuration option
to turn off these content mutating handling?

One may ask why bother with libcurl for a proxy implementation, to which
I'll answer that many attributes of libcurl actually make it very fitting to
this usage pattern. Especially if you do want (like I occasionally do) to
process the response body prior to returning it to the user or benefit from
connection reuse.

Cheers,
Shmul
Received on 2007-01-29