mirror of
https://github.com/tenrok/axios.git
synced 2026-06-23 20:40:40 +03:00
import isURLSameOrigin at top
This commit is contained in:
+1
-2
@@ -42,7 +42,7 @@ module.exports = function xhrAdapter(resolve, reject, config) {
|
|||||||
// Create the request
|
// Create the request
|
||||||
var request = new adapter('Microsoft.XMLHTTP');
|
var request = new adapter('Microsoft.XMLHTTP');
|
||||||
request.open(config.method.toUpperCase(), buildURL(config.url, config.params, config.paramsSerializer), true);
|
request.open(config.method.toUpperCase(), buildURL(config.url, config.params, config.paramsSerializer), true);
|
||||||
|
console.log(request);
|
||||||
// Set the request timeout in MS
|
// Set the request timeout in MS
|
||||||
request.timeout = config.timeout;
|
request.timeout = config.timeout;
|
||||||
|
|
||||||
@@ -78,7 +78,6 @@ module.exports = function xhrAdapter(resolve, reject, config) {
|
|||||||
// Specifically not if we're in a web worker, or react-native.
|
// Specifically not if we're in a web worker, or react-native.
|
||||||
if (utils.isStandardBrowserEnv()) {
|
if (utils.isStandardBrowserEnv()) {
|
||||||
var cookies = require('./../helpers/cookies');
|
var cookies = require('./../helpers/cookies');
|
||||||
var isURLSameOrigin = require('./../helpers/isURLSameOrigin');
|
|
||||||
|
|
||||||
// Add xsrf header
|
// Add xsrf header
|
||||||
var xsrfValue = isURLSameOrigin(config.url) ?
|
var xsrfValue = isURLSameOrigin(config.url) ?
|
||||||
|
|||||||
Reference in New Issue
Block a user