@jupyterlab/services
Advanced tools
Comparing version 0.34.3 to 0.35.0
@@ -149,2 +149,3 @@ // Copyright (c) Jupyter Development Team. | ||
ajaxSettings.method = 'POST'; | ||
ajaxSettings.contentType = 'application/json'; | ||
ajaxSettings.dataType = 'json'; | ||
@@ -156,3 +157,2 @@ if (options) { | ||
ajaxSettings.data = JSON.stringify(options); | ||
ajaxSettings.contentType = 'application/json'; | ||
} | ||
@@ -159,0 +159,0 @@ var url = this._getUrl(options.path || ''); |
@@ -1176,3 +1176,2 @@ // Copyright (c) Jupyter Development Team. | ||
ajaxSettings.dataType = 'json'; | ||
ajaxSettings.contentType = 'application/json'; | ||
ajaxSettings.cache = false; | ||
@@ -1203,3 +1202,2 @@ return utils.ajaxRequest(url, ajaxSettings).then(function (success) { | ||
ajaxSettings.dataType = 'json'; | ||
ajaxSettings.contentType = 'application/json'; | ||
ajaxSettings.cache = false; | ||
@@ -1206,0 +1204,0 @@ return utils.ajaxRequest(url, ajaxSettings).then(function (success) { |
@@ -193,3 +193,4 @@ // Copyright (c) Jupyter Development Team. | ||
function isAvailable() { | ||
return utils.getConfigOption('terminalsAvailable') === 'True'; | ||
var available = utils.getConfigOption('terminalsAvailable'); | ||
return available === 'True' || available === 'true'; | ||
} | ||
@@ -196,0 +197,0 @@ DefaultTerminalSession.isAvailable = isAvailable; |
@@ -130,4 +130,10 @@ // Copyright (c) Jupyter Development Team. | ||
var method = ajaxSettings.method || 'GET'; | ||
// Ensure that requests have applied data. | ||
if (!ajaxSettings.data) { | ||
ajaxSettings.data = '{}'; | ||
ajaxSettings.contentType = 'application/json'; | ||
} | ||
var user = ajaxSettings.user || ''; | ||
var password = ajaxSettings.password || ''; | ||
var headers = ajaxSettings.requestHeaders || {}; | ||
if (!ajaxSettings.cache) { | ||
@@ -149,3 +155,5 @@ // https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest#Bypassing_the_cache. | ||
} | ||
if (typeof document !== 'undefined' && document.cookie) { | ||
// Try to add the xsrf token if there is no existing authorization. | ||
var token = headers['Authorization']; | ||
if (!token && typeof document !== 'undefined' && document.cookie) { | ||
var xsrfToken = _getCookie('_xsrf'); | ||
@@ -156,6 +164,4 @@ if (xsrfToken !== void 0) { | ||
} | ||
if (ajaxSettings.requestHeaders !== void 0) { | ||
for (var prop in ajaxSettings.requestHeaders) { | ||
xhr.setRequestHeader(prop, ajaxSettings.requestHeaders[prop]); | ||
} | ||
for (var prop in headers) { | ||
xhr.setRequestHeader(prop, headers[prop]); | ||
} | ||
@@ -335,3 +341,3 @@ xhr.onload = function (event) { | ||
configData = deepFreeze(configData); | ||
return configData[name]; | ||
return String(configData[name]); | ||
} | ||
@@ -338,0 +344,0 @@ exports.getConfigOption = getConfigOption; |
{ | ||
"name": "@jupyterlab/services", | ||
"version": "0.34.3", | ||
"version": "0.35.0", | ||
"description": "Client APIs for the Jupyter services REST APIs", | ||
@@ -42,7 +42,7 @@ "main": "lib/index.js", | ||
"prepublish": "npm run build && webpack", | ||
"test:coverage": "istanbul cover --dir test/coverage _mocha -- test/build/**/*.spec.js --foo bar --terminalsAvailable True", | ||
"test:coverage": "istanbul cover --dir test/coverage _mocha -- --retries 3 test/build/**/*.spec.js --foo bar --terminalsAvailable True", | ||
"test:integration": "cd test && python integration_test.py", | ||
"test:devtool": "devtool node_modules/mocha/bin/_mocha -qc test/build/**/**.spec.js --foo bar --terminalsAvailable True", | ||
"test:debug": "mocha test/build/**/*.spec.js --foo bar --terminalsAvailable True --debug-brk", | ||
"test": "mocha test/build/**/*.spec.js --foo bar --terminalsAvailable True" | ||
"test": "mocha --retries 3 test/build/**/*.spec.js --foo bar --terminalsAvailable True" | ||
}, | ||
@@ -49,0 +49,0 @@ "repository": { |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
741557
21707