Skip to content

Commit

Permalink
Merge pull request #3 from blue-white-inc/no-cache-proxy
Browse files Browse the repository at this point in the history
No cache proxy
  • Loading branch information
jdinh1 authored Jul 22, 2022
2 parents f0c73c2 + fdbf000 commit 5162c27
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
3 changes: 1 addition & 2 deletions lib/backends/backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ Backend.prototype.serveAsset = function(asset, req, res) {
return d.promise;
}

res.header('Content-Length', asset.size);
res.attachment(asset.filename);

return that.getAssetStream(asset)
Expand All @@ -73,7 +72,7 @@ Backend.prototype.serveAsset = function(asset, req, res) {
return Q(stream
.on('response', function(res) {
delete res.headers['etag'];
res.headers['cache-control'] = 'max-age=7200'
res.headers['cache-control'] = 'max-age=7200';
})
.pipe(res));
}
Expand Down
13 changes: 8 additions & 5 deletions lib/versions.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,21 @@ function normalizeVersion(release) {

// Compare two version
function compareVersions(v1, v2) {
if (semver.gt(v1.tag, v2.tag)) {
try {
if (semver.gt(v1.tag, v2.tag)) {
return -1;
}
if (semver.lt(v1.tag, v2.tag)) {
return 1;
}
} catch(e) {
return -1;
}
if (semver.lt(v1.tag, v2.tag)) {
return 1;
}
return 0;
}

function Versions(backend) {
this.backend = backend;

}

// List versions normalized
Expand Down

0 comments on commit 5162c27

Please sign in to comment.