braid-http
Advanced tools
Comparing version 0.3.18 to 0.3.19
@@ -232,4 +232,4 @@ // var peer = Math.random().toString(36).substr(2) | ||
function start_subscription (cb, error) { | ||
if (!res.ok) | ||
throw new Error('Request returned not ok', res) | ||
if (!res.ok) { | ||
throw new Error('Request returned not ok status:', res.status) | ||
@@ -236,0 +236,0 @@ if (res.bodyUsed) |
@@ -239,7 +239,19 @@ var assert = require('assert') | ||
res.setHeader('cache-control', 'no-cache, no-transform') | ||
if (req.httpVersionMajor == 1) { | ||
// Explicitly disable transfer-encoding chunked for http 1 | ||
res.setHeader('transfer-encoding', '') | ||
} | ||
// Note: I used to explicitly disable transfer-encoding chunked | ||
// here by setting the header to empty string. This is the only | ||
// way I know to disable it in nodejs. We don't need chunked | ||
// encoding in subscriptions, because chunked encoding is used to | ||
// signal the end of a response, and subscriptions don't end. I | ||
// disabled them to make responses cleaner. However, it turns out | ||
// the Caddy proxy throws an error if it receives a response with | ||
// transfer-encoding: set to the empty string. So I'm disabling | ||
// it now. | ||
// if (req.httpVersionMajor == 1) { | ||
// // Explicitly disable transfer-encoding chunked for http 1 | ||
// res.setHeader('transfer-encoding', '') | ||
// } | ||
// Tell nginx not to buffer the subscription | ||
@@ -246,0 +258,0 @@ res.setHeader('X-Accel-Buffering', 'no') |
{ | ||
"name": "braid-http", | ||
"version": "0.3.18", | ||
"version": "0.3.19", | ||
"description": "An implementation of Braid-HTTP for Node.js and Browsers", | ||
@@ -5,0 +5,0 @@ "scripts": { |
48728
983