Merge pull request #2631 from Manishearth/xhr-spaces

Fix field-value checking to not throw for lone spaces; r=jdm
This commit is contained in:
Ms2ger 2014-06-21 11:08:20 +02:00
commit ab711fcf0c

View file

@ -94,7 +94,21 @@ impl ByteString {
false
}
},
32 | 9 => { // SP | HT
32 => { // SP
if prev == LF || prev == SPHT {
prev = SPHT;
true
} else if prev == Other {
// Counts as an Other here, since it's not preceded by a CRLF
// SP is not a CTL, so it can be used anywhere
// though if used immediately after a CR the CR is invalid
// We don't change prev since it's already Other
true
} else {
false
}
},
9 => { // HT
if prev == LF || prev == SPHT {
prev = SPHT;
true