cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Adding empty HTTP Headers to curl requests?

From: Richard Atterer <richard_at_2006.atterer.net>
Date: Thu, 26 Jan 2006 13:29:25 +0100

On Thu, Jan 26, 2006 at 12:32:26PM +0100, Daniel Stenberg wrote:
> Not really, but I'm thinking we could for example exploit the fact that
> headers aren't allowed to contain ascii 1 - 31, not in the name nor in the
> "field-body" part. Thus we could easily for example let "header:\x01" mean
> "add this header with a blank data". We could even hide the kludgy feeling
> by using a define instead of \x01, like: "header:" NO_FIELD_BODY or similar.
>
> Opinions? Other ideas?

You could distinguish between "Header:" and "Header: " with a trailing
space.

According to RFC 2616, the server should ignore leading whitespace in the
header value, so you could remove the header for "Header:" and send it for
"Header: "

   The field-content does not include any leading or trailing LWS:
   linear white space occurring before the first non-whitespace
   character of the field-value or after the last non-whitespace
   character of the field-value. Such leading or trailing LWS MAY be
   removed without changing the semantics of the field value. Any LWS
   that occurs between field-content MAY be replaced with a single SP
   before interpreting the field value or forwarding the message
   downstream.

Cheers,

  Richard

-- 
  __   _
  |_) /|  Richard Atterer     |  GnuPG key: 0x888354F7
  | \/¯|  http://atterer.net  |  08A9 7B7D 3D13 3EF2 3D25  D157 79E6 F6DC 8883 54F7
  ¯ '` ¯
Received on 2006-01-26