getRequestHeader should be case-insensitive #20

driverdan opened this Issue Feb 20, 2012 · 3 comments


None yet

4 participants


Per spec headers should be case-insensitive as should any functions that access them. getRequestHeader currently assumes a case match.

Consider rewriting all response header related code to use a string to store headers instead of an array. A regex can then be used to retrieve headers and ignore case.

max99x commented Apr 18, 2013

+1. This is particularly painful when you setRequestHeader with "Content-type", while the code checks explicitly for "Content-Type", and ends up overwriting your specified type with the default text/plain.

eladb commented Jan 21, 2015


dbo commented May 21, 2015

Why not simply use lower-cased values. A lot of libraries (e.g. github's fetch polyfill) normalize into lower-cased header keys.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment