Permalink
Browse files

Allow the main application to deny range requests by setting response…

… header "Accept-Ranges" to "none". This also enables a workaround for connect bug senchalabs/connect#599 .
  • Loading branch information...
bf committed Aug 16, 2012
1 parent 666682c commit f2f61f64a0f394e146b88a88123c5c311ac6c8ae
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/send.js
View
@@ -454,7 +454,7 @@ SendStream.prototype.type = function(path){
SendStream.prototype.setHeader = function(stat){
var res = this.res;
- res.setHeader('Accept-Ranges', 'bytes');
+ if (!res.getHeader('Accept-Ranges')) res.setHeader('Accept-Ranges', 'bytes');
if (!res.getHeader('ETag')) res.setHeader('ETag', utils.etag(stat));
if (!res.getHeader('Date')) res.setHeader('Date', new Date().toUTCString());
if (!res.getHeader('Cache-Control')) res.setHeader('Cache-Control', 'public, max-age=' + (this._maxage / 1000));

0 comments on commit f2f61f6

Please sign in to comment.