Skip to content

Commit

Permalink
Support obs-fold as header delimiter
Browse files Browse the repository at this point in the history
  • Loading branch information
kwgithubusername committed Mar 6, 2017
1 parent d4ed806 commit 9160772
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,10 @@

function parseHeaders(rawHeaders) {
var headers = new Headers()
rawHeaders.split(/\r?\n/).forEach(function(line) {
// 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 ]+/, ' ')
preProcessedHeaders.split(/\r?\n/).forEach(function(line) {
var parts = line.split(':')
var key = parts.shift().trim()
if (key) {
Expand Down

0 comments on commit 9160772

Please sign in to comment.