Re: [whatwg/fetch] Stop lowercasing header names (#476)

youennf commented on this pull request.



> -<a>header</a> whose <a for=header>name</a>
-is <var>name</var>, <a lt="byte-lowercase">byte-lowercased</a>, and
-<a for=header>value</a> is <var>value</var>, to
-<var>list</var>.
+<a for=header>name</a>/<a for=header>value</a> (<var>name</var>/<var>value</var>) pair to a
+<a for=/>header list</a> (<var>list</var>), run these steps:
+
+<ol>
+ <li>
+  <p>If <var>list</var> <a for="header list">contains</a> <var>name</var>, then set <var>name</var>
+  to the first such <a>header</a>'s <a for=header>name</a>.
+
+  <p class="note no-backref">This reuses the casing of the <a for=header>name</a> of the
+  <a>header</a> already in the <a for=/>header list</a>, if any. If there are multiple matched
+  <a>headers</a> their <a for=header>names</a> will all be identical.
+  <!-- XXX Firefox and Safari adjust known header names too. -->

I like the simplicity that provided case-insensitive header names to the spec.
Maybe a serialization context could have stored the casing information to leave the header names case-insensitive.
But anyway, this looks good to me as the PR is taking great care of making the specific casing unobservable from JS scripts.

I would tend to write the above statements as SHOULD/MUST/MAY, something like:
All matching headers must use the same casing.
The casing of the first header already in the list should be used for all matching headers.
The user agent may use its own casing for well-known headers.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/pull/476#pullrequestreview-20928249

Received on Thursday, 9 February 2017 04:27:22 UTC