kopia lustrzana https://github.com/c9/core
set cace-control header for preview files
rodzic
eda61cfd08
commit
089be2fd68
|
@ -147,7 +147,6 @@ define(function(require, exports, module) {
|
||||||
var isDir = path[path.length-1] == "/";
|
var isDir = path[path.length-1] == "/";
|
||||||
if (isDir || parsedUrl.pathname.match(/\.html?$/i)) {
|
if (isDir || parsedUrl.pathname.match(/\.html?$/i)) {
|
||||||
req.headers["accept-encoding"] = "identity";
|
req.headers["accept-encoding"] = "identity";
|
||||||
delete req.headers["if-none-match"];
|
|
||||||
delete req.headers["if-range"];
|
delete req.headers["if-range"];
|
||||||
} else {
|
} else {
|
||||||
req.headers["accept-encoding"] = "gzip";
|
req.headers["accept-encoding"] = "gzip";
|
||||||
|
@ -327,6 +326,8 @@ define(function(require, exports, module) {
|
||||||
function serveFile(request) {
|
function serveFile(request) {
|
||||||
debug("forward file %s", request.url);
|
debug("forward file %s", request.url);
|
||||||
request.headers["x-robots-tag"] = "noindex, nofollow";
|
request.headers["x-robots-tag"] = "noindex, nofollow";
|
||||||
|
if (!request.headers["Cache-Control"])
|
||||||
|
request.headers["Cache-Control"] = "max-age=31536000,no-cache";
|
||||||
res.writeHead(request.statusCode, request.headers);
|
res.writeHead(request.statusCode, request.headers);
|
||||||
request.pipe(res);
|
request.pipe(res);
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue