Skip to content

Retrieving request header correctly #2635

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 1, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Routers/FilesRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export class FilesRouter {
}

function isFileStreamable(req, filesController){
if (req.get['Range']) {
if (req.get('Range')) {
if (!(typeof filesController.adapter.getFileStream === 'function')) {
return false;
}
Expand All @@ -124,7 +124,7 @@ function isFileStreamable(req, filesController){
function handleFileStream(stream, req, res, contentType) {
var buffer_size = 1024 * 1024;//1024Kb
// Range request, partiall stream the file
var parts = req.get["Range"].replace(/bytes=/, "").split("-");
var parts = req.get('Range').replace(/bytes=/, "").split("-");
var partialstart = parts[0];
var partialend = parts[1];
var start = partialstart ? parseInt(partialstart, 10) : 0;
Expand Down