Skip to content

Commit

Permalink
Tell the client that the server can accept byte ranges even if it has…
Browse files Browse the repository at this point in the history
…n't requested them. This allows streaming to work in IE11, which will not try to request a byte range unless it gets this header first.
  • Loading branch information
Pam authored and vvo committed Oct 13, 2014
1 parent 1dfd426 commit a24a983
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Expand Up @@ -231,14 +231,14 @@ var downloadHeader = function (res, info) {
"Cache-Control": "public; max-age=" + settings.maxAge,
Connection: "keep-alive",
"Content-Type": info.mime,
"Content-Disposition": "inline; filename=" + info.file + ";"
"Content-Disposition": "inline; filename=" + info.file + ";",
"Accept-Ranges": "bytes"
};

if (info.rangeRequest) {
// Partial http response
code = 206;
header.Status = "206 Partial Content";
header["Accept-Ranges"] = "bytes";
header["Content-Range"] = "bytes " + info.start + "-" + info.end + "/" + info.size;
}
}
Expand Down

0 comments on commit a24a983

Please sign in to comment.