braid-http
Advanced tools
Comparing version 1.3.9 to 1.3.10
@@ -165,5 +165,5 @@ // var peer = Math.random().toString(36).substr(2) | ||
if (params.version) | ||
params.headers.set('version', params.version.map(JSON.stringify).join(', ')) | ||
params.headers.set('version', params.version.map(JSON.stringify).map(ascii_ify).join(', ')) | ||
if (Array.isArray(params.parents)) | ||
params.headers.set('parents', params.parents.map(JSON.stringify).join(', ')) | ||
params.headers.set('parents', params.parents.map(JSON.stringify).map(ascii_ify).join(', ')) | ||
if (params.subscribe) | ||
@@ -399,3 +399,3 @@ params.headers.set('subscribe', 'true') | ||
case 504: // Gateway Timeout | ||
give_up = false; | ||
give_up = false | ||
} | ||
@@ -583,3 +583,3 @@ if (give_up) { | ||
// Find the start of the headers | ||
let start = 0; | ||
var start = 0 | ||
while (input[start] === 13 || input[start] === 10) start++ | ||
@@ -589,3 +589,3 @@ if (start === input.length) return {result: 'waiting'} | ||
// Look for the double-newline at the end of the headers. | ||
let end = start; | ||
var end = start | ||
while (++end) { | ||
@@ -823,2 +823,6 @@ if (end > input.length) return {result: 'waiting'} | ||
function ascii_ify(s) { | ||
return s.replace(/[^\x20-\x7E]/g, c => '\\u' + c.charCodeAt(0).toString(16).padStart(4, '0')) | ||
} | ||
// **************************** | ||
@@ -825,0 +829,0 @@ // Exports |
@@ -403,6 +403,6 @@ var assert = require('assert') | ||
header = 'Version' // Capitalize for prettiness | ||
value = value.map(JSON.stringify).join(", ") | ||
value = value.map(JSON.stringify).map(ascii_ify).join(", ") | ||
} else if (header === 'parents') { | ||
header = 'Parents' // Capitalize for prettiness | ||
value = value.map(JSON.stringify).join(", ") | ||
value = value.map(JSON.stringify).map(ascii_ify).join(", ") | ||
} | ||
@@ -451,2 +451,6 @@ | ||
function ascii_ify(s) { | ||
return s.replace(/[^\x20-\x7E]/g, c => '\\u' + c.charCodeAt(0).toString(16).padStart(4, '0')) | ||
} | ||
module.exports = braidify |
{ | ||
"name": "braid-http", | ||
"version": "1.3.9", | ||
"version": "1.3.10", | ||
"description": "An implementation of Braid-HTTP for Node.js and Browsers", | ||
@@ -5,0 +5,0 @@ "scripts": { |
55711
1081