Skip to content

Commit

Permalink
Merge branch 'master' into docker-build
Browse files Browse the repository at this point in the history
  • Loading branch information
colloqi committed Apr 26, 2023
2 parents 262b091 + 0d7a126 commit 3fb9c35
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions config/express.js
Expand Up @@ -107,6 +107,11 @@ module.exports = function (app) {

//app.use('/sync_folders',serveIndex(config.syncDir));
app.use('/sync_folders',function(req, res, next){
// Player uses --no-cache header in wget to download assets. The --no-cache flag sends the following headers
// Cache-Control: no-cache , Pragma: no-cache
// This causes 200 OK response for all requests. Hence remove this header to minimise data-transfer costs.
delete req.headers['cache-control']; // delete header
delete req.headers['pragma']; // delete header
fs.stat(path.join(config.syncDir,req.path), function(err, stat){
if (!err && stat.isDirectory()) {
res.setHeader('Last-Modified', (new Date()).toUTCString());
Expand Down

0 comments on commit 3fb9c35

Please sign in to comment.