Skip to content
Myr

preserve casing of headers in res.header and res.set

Before adoption: this commit came in with the history the project adopted, so no landing records it.

fixes #2063

authored by Douglas Christopher Wilson · committed by Douglas Christopher Wilson · parent 374e6c3 · Browse files · 1 file+1 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+1 added−2 removed

  • other:+1 added−2 removed

1 file+1 added−2 removed

modified:lib/response.js+1 added-2 removed
517 unmodified lines
518res.header = function(field, val){519 if (2 == arguments.length) {520 if (Array.isArray(val)) val = val.map(String);521 else val = String(val);522 field = field.toLowerCase();523 if ('content-type' == field && !/;\s*charset\s*=/.test(val)) {522 if ('content-type' == field.toLowerCase() && !/;\s*charset\s*=/.test(val)) {523 var charset = mime.charsets.lookup(val.split(';')[0]);524 if (charset) val += '; charset=' + charset.toLowerCase();525 }526 this.setHeader(field, val);
254 unmodified lines