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 c3d2ca1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fetch.js
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.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 c3d2ca1

Please sign in to comment.