Message183410
OK. I'm inclined to think that we should both remove trailing and leading spaces/tabs should be removed.
Reasons:
1. Production rules forbid them.
2. Trailing spaces
2.a Conformant servers will ignore with a 400 bad request (opportunity for another bugs?)
2.b Conformant proxies will rewrite the header by removing spaces.
3. Leading spaces are continuation lines. See below.
I had completely missed that. The syntax for headers is:
header-field = field-name ":" OWS field-value BWS
field-name = token
field-value = *( field-content / obs-fold )
field-content = *( HTAB / SP / VCHAR / obs-text )
obs-fold = CRLF ( SP / HTAB )
; obsolete line folding
; see Section 3.2.4
obs-fold is about line folding which is basically a header that would look like:
foo: bar\n
blah: something
which could be the equivalent of:
foo: bar blah: something
with "foo" the header field-name and "bar blah: something" the header field-value.
which is clearly not the intent of an author doing:
request.add_header('Accept', 'text/html')
request.add_header(' User-Agent', 'foobar/1.0')
because this would be parsed by a conformant server as
Accept: text/html User-Agent: foobar/1.0 |
|
Date |
User |
Action |
Args |
2013-03-03 23:08:10 | karlcow | set | recipients:
+ karlcow, orsenthil, r.david.murray |
2013-03-03 23:08:09 | karlcow | set | messageid: <1362352089.99.0.794632562373.issue17322@psf.upfronthosting.co.za> |
2013-03-03 23:08:09 | karlcow | link | issue17322 messages |
2013-03-03 23:08:09 | karlcow | create | |
|