kopia lustrzana https://github.com/c9/core
Avoid downloading from subsubdomains like ide.newclient-lennnartcl.c9.io
Since these don't have a valid certificate, they don't support cachingpull/117/merge
rodzic
2c656ebb3a
commit
27170b3454
|
@ -17,21 +17,21 @@ function plugin(options, imports, register) {
|
||||||
var apiBaseUrl = options.apiBaseUrl;
|
var apiBaseUrl = options.apiBaseUrl;
|
||||||
var vfsBaseUrl = options.vfsBaseUrl;
|
var vfsBaseUrl = options.vfsBaseUrl;
|
||||||
|
|
||||||
connectStatic.getRequireJsConfig().baseUrlLoadBalancers = [
|
var balancers = [
|
||||||
ideBaseUrl,
|
|
||||||
baseUrl + "/uph",
|
baseUrl + "/uph",
|
||||||
// We could include others but dogfooding URLs like
|
|
||||||
// vfs.newclient-lennartcl.c9.io don't have a cert, so
|
|
||||||
// let's not
|
|
||||||
// apiBaseUrl + "/uph",
|
|
||||||
// vfsBaseUrl + "/uph",
|
|
||||||
];
|
];
|
||||||
assert(connectStatic.getRequireJsConfig().baseUrlLoadBalancers);
|
if (!options.avoidSubdomains)
|
||||||
|
balancers.push(
|
||||||
|
ideBaseUrl
|
||||||
|
// We could include others but dogfooding URLs like
|
||||||
|
// vfs.newclient-lennartcl.c9.io don't have a cert, so
|
||||||
|
// let's not
|
||||||
|
// apiBaseUrl + "/uph",
|
||||||
|
// vfsBaseUrl + "/uph"
|
||||||
|
);
|
||||||
|
|
||||||
function cacheForever(req, res, next) {
|
connectStatic.getRequireJsConfig().baseUrlLoadBalancers = balancers;
|
||||||
res.setHeader("Cache-Control", "public, max-age=31556926");
|
assert(connectStatic.getRequireJsConfig().baseUrlLoadBalancers);
|
||||||
next();
|
|
||||||
}
|
|
||||||
|
|
||||||
register(null, {
|
register(null, {
|
||||||
"unpacked_helper": {}
|
"unpacked_helper": {}
|
||||||
|
|
Ładowanie…
Reference in New Issue