Skip to content

Commit

Permalink
Deleting cache-control header on redirect responses, removing `grun…
Browse files Browse the repository at this point in the history
…t-nsp` module due to audit warnings from `npm`
  • Loading branch information
avoidwork committed Jun 4, 2018
1 parent a90bd50 commit e97e7dc
Show file tree
Hide file tree
Showing 4 changed files with 148 additions and 576 deletions.
4 changes: 0 additions & 4 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ module.exports = function (grunt) {
src: ["test/*_test.js"/*, "test/*_test2.js"*/]
}
},
nsp: {
package: grunt.file.readJSON("package.json")
},
watch: {
js: {
files: ["*.js", "lib/*.js"],
Expand All @@ -31,7 +28,6 @@ module.exports = function (grunt) {
// tasks
grunt.loadNpmTasks("grunt-eslint");
grunt.loadNpmTasks("grunt-mocha-test");
grunt.loadNpmTasks("grunt-nsp");
grunt.loadNpmTasks("grunt-contrib-watch");

// aliases
Expand Down
5 changes: 5 additions & 0 deletions lib/tenso.js
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,11 @@ class Tenso extends HTTPMethods {
}
});

if (status >= 300 && status < 400 && rheaders["cache-control"] !== void 0) {
res.removeHeader("cache-control");
delete headers["cache-control"];
}

if (status !== 416 && req.headers.range !== void 0 && !res.hasHeader("content-range") && headers["content-range"] === void 0) {
this.error(req, res, new Error(416), headers).then(resolve, reject);
} else {
Expand Down
Loading

0 comments on commit e97e7dc

Please sign in to comment.