Skip to content

Commit

Permalink
Merge pull request JakeChampion#496 from woudini/fix-header-delimiter
Browse files Browse the repository at this point in the history
Add global replace for processing raw headers
  • Loading branch information
mislav authored Apr 8, 2017
2 parents fcf8476 + f1207ed commit 08602ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@
var headers = new Headers()
// Replace instances of \r\n and \n followed by at least one space or horizontal tab with a space
// https://tools.ietf.org/html/rfc7230#section-3.2
var preProcessedHeaders = rawHeaders.replace(/\r?\n[\t ]+/, ' ')
var preProcessedHeaders = rawHeaders.replace(/\r?\n[\t ]+/g, ' ')
preProcessedHeaders.split(/\r?\n/).forEach(function(line) {
var parts = line.split(':')
var key = parts.shift().trim()
Expand Down

0 comments on commit 08602ff

Please sign in to comment.