Skip to content
This repository has been archived by the owner on Sep 3, 2022. It is now read-only.

Commit

Permalink
Fix some indentation; no code changes. (#1306)
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmc authored Apr 6, 2017
1 parent d307aea commit 75a0fb8
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion sources/web/datalab/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ function setOauth2Client(request: http.ServerRequest): void {
// are limited to localhost only. We should consider making this
// configurable, or using the OAuth flow for non-web applications.
oauth2Client = new OAuth2(clientId, clientSecret,
'http://localhost:' + getPortNumber(request) + '/oauthcallback');
'http://localhost:' + getPortNumber(request) + '/oauthcallback');
}
}

Expand Down
4 changes: 2 additions & 2 deletions sources/web/datalab/jupyter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -414,8 +414,8 @@ function responseHandler(proxyResponse: http.ClientResponse,
request: http.ServerRequest, response: http.ServerResponse) {
if (appSettings.allowOriginOverrides.length &&
appSettings.allowOriginOverrides.indexOf(request.headers['origin']) != -1) {
proxyResponse.headers['access-control-allow-origin'] = request.headers['origin'];
proxyResponse.headers['access-control-allow-credentials'] = 'true';
proxyResponse.headers['access-control-allow-origin'] = request.headers['origin'];
proxyResponse.headers['access-control-allow-credentials'] = 'true';
} else if (proxyResponse.headers['access-control-allow-origin'] !== undefined) {
// Delete the allow-origin = * header that is sent (likely as a result of a workaround
// notebook configuration to allow server-side websocket connections that are
Expand Down
22 changes: 11 additions & 11 deletions sources/web/datalab/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ function handleRequest(request: http.ServerRequest,

var userId = userManager.getUserId(request);
if (loadedSettings === null) {
loadedSettings = settings_.loadUserSettings(userId);
loadedSettings = settings_.loadUserSettings(userId);
}
// All requests below are logged, while the ones above aren't, to avoid generating noise
// into the log.
Expand All @@ -121,9 +121,9 @@ function handleRequest(request: http.ServerRequest,

response.statusCode = 302;
if (startup_path_setting in loadedSettings) {
response.setHeader('Location', loadedSettings[startup_path_setting])
response.setHeader('Location', loadedSettings[startup_path_setting])
} else {
response.setHeader('Location', '/tree/datalab');
response.setHeader('Location', '/tree/datalab');
}
response.end();
return;
Expand Down Expand Up @@ -156,15 +156,15 @@ function handleRequest(request: http.ServerRequest,
(path.indexOf('/sessions') == 0)) {

if (path.indexOf('/tree') == 0) {
const filePath = '/content' + path.substr('/tree'.length);
try {
if (fs.existsSync(filePath) && fs.statSync(filePath).isDirectory()) {
loadedSettings[startup_path_setting] = path
settings_.updateUserSetting(userId, startup_path_setting, path, true);
}
} catch (err) {
logging.getLogger().error(err, 'Failed check for file "%s": %s', filePath, err.code);
const filePath = '/content' + path.substr('/tree'.length);
try {
if (fs.existsSync(filePath) && fs.statSync(filePath).isDirectory()) {
loadedSettings[startup_path_setting] = path
settings_.updateUserSetting(userId, startup_path_setting, path, true);
}
} catch (err) {
logging.getLogger().error(err, 'Failed check for file "%s": %s', filePath, err.code);
}
}
handleJupyterRequest(request, response);
return;
Expand Down
6 changes: 3 additions & 3 deletions sources/web/datalab/static.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ function sendJupyterFile(relativePath: string, response: http.ServerResponse) {
* @param filePath the relative path of the file.
*/
export function datalabFileExists(filePath: string) {
return fs.existsSync(path.join(__dirname, 'static', filePath));
return fs.existsSync(path.join(__dirname, 'static', filePath));
}

/**
Expand All @@ -146,8 +146,8 @@ export function datalabFileExists(filePath: string) {
* @param response the out-going response associated with the current HTTP request.
*/
function sendUserCustomTheme(userId: string, response: http.ServerResponse): void {
var customThemePath = path.join(settings.getUserConfigDir(userId), CUSTOM_THEME_FILE);
sendFile(customThemePath, response, DEFAULT_THEME_FILE, true);
var customThemePath = path.join(settings.getUserConfigDir(userId), CUSTOM_THEME_FILE);
sendFile(customThemePath, response, DEFAULT_THEME_FILE, true);
}

/**
Expand Down

0 comments on commit 75a0fb8

Please sign in to comment.