Unverified Commit 2eee90e9 authored by Sam Roberts's avatar Sam Roberts Committed by Beth Griggs
Browse files

http: strip trailing OWS from header values

HTTP header values can have trailing OWS, but it should be stripped.  It
is not semantically part of the header's value, and if treated as part
of the value, it can cause spurious inequality between expected and
actual header values.

Note that a single SPC of leading OWS is common before the field-value,
and it is already handled by the HTTP parser by stripping all leading
OWS. It is only the trailing OWS that must be stripped by the parser
user.

	header-field   = field-name ":" OWS field-value OWS
	    ; https://tools.ietf.org/html/rfc7230#section-3.2
	OWS            = *( SP / HTAB )
	    ; https://tools.ietf.org/html/rfc7230#section-3.2.3

Fixes: https://hackerone.com/reports/730779

PR-URL: https://github.com/nodejs-private/node-private/pull/191


Reviewed-By: default avatarMatteo <Collina &lt;matteo.collina@gmail.com>
Reviewed-By: default avatarBen <Noordhuis &lt;info@bnoordhuis.nl>
Reviewed-By: default avatarColin Ihrig <cjihrig@gmail.com>
Reviewed-By: default avatarBeth Griggs <Bethany.Griggs@uk.ibm.com>
parent 84eec80f
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment