Revert "Put user content on a different domain"

pull/223/head
Fabian Jakobs 2015-10-19 17:22:19 +02:00
rodzic bee22480da
commit 043984c8e1
5 zmienionych plików z 13 dodań i 42 usunięć

9
node_modules/c9/object.js wygenerowano vendored
Wyświetl plik

@ -1,9 +0,0 @@
/*
* Swap keys and values of an object
*/
exports.invert = function(obj) {
return Object.keys(obj).reduce(function(res, key) {
res[obj[key]] = key;
return res;
}, {});
};

9
node_modules/c9/string.js wygenerowano vendored
Wyświetl plik

@ -43,14 +43,5 @@ exports.repeat = function(str, times) {
exports.count = function(str, substr){
return str.split(substr).length - 1;
};
exports.endsWith = function(subjectString, searchString, position) {
if (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > subjectString.length) {
position = subjectString.length;
}
position -= searchString.length;
var lastIndex = subjectString.indexOf(searchString, position);
return lastIndex !== -1 && lastIndex === position;
};
});

14
node_modules/c9/urls.js wygenerowano vendored
Wyświetl plik

@ -22,14 +22,6 @@ function main(options, imports, register) {
});
}
plugin.getHost = function(req) {
return (req.headers && req.headers.host
|| req.host
|| req.url && req.url.replace(/^https?:\/\/([^/]*).*/, "$1")
|| req
);
};
/**
* Get a desired base URL, given some context.
*
@ -38,8 +30,10 @@ plugin.getHost = function(req) {
* @param {String} targetBaseUrlPattern The target URL pattern, e.g. https://$DOMAIN
*/
plugin.getBaseUrl = function(req, sourceBaseUrlPattern, targetBaseUrlPattern) {
var sourceHost = plugin.getHost(req);
var sourceHost = req.headers && req.headers.host
|| req.host
|| req.url && req.url.replace(/^https?:\/\/([^/]*).*/, "$1")
|| req;
if (typeof sourceHost !== "string")
throw new Error("Not a valid request object: " + req);
if (!sourceBaseUrlPattern)

Wyświetl plik

@ -39,13 +39,7 @@ define(function(require, exports, module) {
session.ws = {};
req.projectSession = session.ws[ws];
if (
!req.projectSession ||
!req.projectSession.expires ||
req.projectSession.expires <= Date.now() ||
req.projectSession.uid != req.user.id
) {
if (!req.projectSession || !req.projectSession.expires || req.projectSession.expires <= Date.now()) {
req.projectSession = session.ws[ws] = {
expires: Date.now() + 10000
};
@ -83,7 +77,6 @@ define(function(require, exports, module) {
}
req.projectSession.role = role;
req.projectSession.pid = project.id;
req.projectSession.uid = req.user.id;
var type = project.scm;
req.projectSession.type = type;
@ -144,8 +137,8 @@ define(function(require, exports, module) {
var path = req.params.path;
var url = req.proxyUrl + path;
if (req.user.code)
url += "?access_token=" + encodeURIComponent(req.user.code);
if (req.session.token)
url += "?access_token=" + encodeURIComponent(req.session.token.id || req.session.token);
var parsedUrl = parseUrl(url);
var httpModule = parsedUrl.protocol == "https:" ? https : http;

Wyświetl plik

@ -23,12 +23,14 @@ var DEFAULT_CONFIG = "s";
var DEFAULT_SETTINGS = getDefaultSettings();
var shortcuts = {
"dev" : ["ide", "preview", "user-content", "vfs", "api", "sapi", "proxy", "redis", "profile", "oldclient", "homepage", "apps-proxy", "-s", "devel"],
"odev" : ["ide", "preview", "user-content", "vfs", "api", "proxy", "oldclient", "homepage", "apps-proxy", "profile", "worker", "-s", "onlinedev"],
"beta" : ["ide", "preview", "user-content", "vfs", "proxy", "-s", "beta"],
"dev" : ["ide", "preview", "vfs", "api", "sapi", "proxy", "redis", "profile", "oldclient", "homepage", "apps-proxy", "-s", "devel"],
"odev" : ["ide", "preview", "vfs", "api", "proxy", "oldclient", "homepage", "apps-proxy", "profile", "worker", "-s", "onlinedev"],
"bill" : ["ide", "preview", "vfs", "api", "proxy", "oldclient", "homepage", "apps-proxy", "profile", "-s", "billing"],
"beta" : ["ide", "preview", "vfs", "proxy", "-s", "beta"],
"ci" : ["ide", "preview", "vfs", "proxy", "-s", "ci"],
"s" : ["standalone", "-s", "standalone"]
};
var delayLoadConfigs = ["preview", "user-content", "api", "oldclient", "apps-proxy", "worker"];
var delayLoadConfigs = ["preview", "api", "oldclient", "apps-proxy", "worker"];
module.exports = main;