Subject: header parsing, trailing OWS

From: Julian Reschke <[email-masked]>
Date: Thu, 24 Sep 2009 17:02:45 +0200

Hi,

in part 1 we currently say:

"The field value MAY be preceded by optional whitespace; a single SP is 
preferred. The field-value does not include any leading or trailing 
white space: OWS occurring before the first non-whitespace character of 
the field-value or after the last non-whitespace character of the 
field-value is ignored and MAY be removed without changing the meaning 
of the header field." -- 
<http://greenbytes.de/tech/webdav/draft-ietf-httpbis-p1-messaging-07.html#rfc.section.4.2.p.4>

In the current edits, the last 'MAY' is a 'SHOULD', which makes it read

"A field value MAY be preceded by optional whitespace (OWS); a single SP 
is preferred. The field value does not include any leading or trailing 
white space: OWS occurring before the first non-whitespace character of 
the field value or after the last non-whitespace character of the field 
value is ignored and SHOULD be removed without changing the meaning of 
the header field."

I think what we really should say is that they MAY be removed before 
passing the field-value to a specific header parser, thus definitions of 
headers MUST NOT make the presence of trailing/leading whitespace 
semantically significant.

BR, Julian

---

From: David Morris <[email-masked]>
Date: Thu, 24 Sep 2009 09:34:39 -0700 (PDT)

On Thu, 24 Sep 2009, Julian Reschke wrote:

> "A field value MAY be preceded by optional whitespace (OWS); a single SP is 
> preferred. The field value does not include any leading or trailing white 
> space: OWS occurring before the first non-whitespace character of the field 
> value or after the last non-whitespace character of the field value is 
> ignored and SHOULD be removed without changing the meaning of the header 
> field."

Doesn't read smoothly .... and infact turns into a directive rather than a 
permission.

One alternate to illustrate my point ...
    "SHOULD be removed" --> "SHOULD be able to"
another ... replace the remainder after "the field value is ignored and"
with:
     "removing OWS before or after the field value SHOULD NOT change the
      meaning of the header field."

---

From: Jamie Lokier <[email-masked]>
Date: Sat, 26 Sep 2009 15:41:54 +0100

> semantically significant.

Should proxies edit the leading or trailing OWS before forwarding headers?

-- Jamie

---

From: Julian Reschke <[email-masked]>
Date: Sat, 26 Sep 2009 16:56:20 +0200

Jamie Lokier wrote:
> ...
> ...

I'm not sure. Do you think they should?

BR, Julian

---

From: David Morris <[email-masked]>
Date: Sat, 26 Sep 2009 09:47:32 -0700 (PDT)

> I'm not sure. Do you think they should?

I think they MAY ... but it shouldn't be a matter of any degree of 
compliance if it is easier for the proxy author to relay the reader as 
received.