Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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...
commit f2f61f64a0f394e146b88a88123c5c311ac6c8ae 1 parent 666682c
@bf authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/send.js
View
2  lib/send.js
@@ -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));
Please sign in to comment.
Something went wrong with that request. Please try again.