Support GET and HEAD.
parent
a09e208b0a
commit
a5365f2547
|
@ -155,7 +155,7 @@ async.waterfall([
|
||||||
});
|
});
|
||||||
|
|
||||||
//serve minified files
|
//serve minified files
|
||||||
app.get('/minified/:filename', minify.minifyJS);
|
app.all('/minified/:filename', minify.minifyJS);
|
||||||
|
|
||||||
//checks for padAccess
|
//checks for padAccess
|
||||||
function hasPadAccess(req, res, callback)
|
function hasPadAccess(req, res, callback)
|
||||||
|
|
|
@ -85,10 +85,18 @@ function _handle(req, res, jsFilename, jsFiles) {
|
||||||
res.writeHead(304, {});
|
res.writeHead(304, {});
|
||||||
res.end();
|
res.end();
|
||||||
} else {
|
} else {
|
||||||
if (settings.minify) {
|
if (req.method == 'HEAD') {
|
||||||
respondMinified();
|
res.writeHead(200, {});
|
||||||
|
res.end();
|
||||||
|
} else if (req.method == 'GET') {
|
||||||
|
if (settings.minify) {
|
||||||
|
respondMinified();
|
||||||
|
} else {
|
||||||
|
respondRaw();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
respondRaw();
|
res.writeHead(405, {'allow': 'HEAD, GET'});
|
||||||
|
res.end();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue