Skip to content

Commit

Permalink
Add global replace for processing raw headers
Browse files Browse the repository at this point in the history
  • Loading branch information
kwgithubusername committed Mar 14, 2017
1 parent 37dcb92 commit f1207ed
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 f1207ed

Please sign in to comment.