mirror of
https://github.com/tenrok/axios.git
synced 2026-05-24 14:04:14 +03:00
fix linting errors
This commit is contained in:
+4
-4
@@ -19,7 +19,7 @@ module.exports = function xhrAdapter(resolve, reject, config) {
|
||||
|
||||
// For IE 8/9 CORS support
|
||||
// Only supports POST and GET calls and doesn't returns the response headers.
|
||||
if (window.XDomainRequest && !("withCredentials" in request) && !isURLSameOrigin(config.url)) {
|
||||
if (window.XDomainRequest && !('withCredentials' in request) && !isURLSameOrigin(config.url)) {
|
||||
request = new window.XDomainRequest();
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ module.exports = function xhrAdapter(resolve, reject, config) {
|
||||
return;
|
||||
}
|
||||
// Prepare the response
|
||||
var responseHeaders = "getAllResponseHeaders" in request ? parseHeaders(request.getAllResponseHeaders()) : null;
|
||||
var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;
|
||||
var responseData = ['text', ''].indexOf(config.responseType || '') !== -1 ? request.responseText : request.response;
|
||||
var response = {
|
||||
data: transformData(
|
||||
@@ -55,7 +55,7 @@ module.exports = function xhrAdapter(resolve, reject, config) {
|
||||
config: config
|
||||
};
|
||||
// Resolve or reject the Promise based on the status
|
||||
((request.status >= 200 && request.status < 300) || (!("status" in request) && request.responseText) ?
|
||||
((request.status >= 200 && request.status < 300) || (!('status' in request) && request.responseText) ?
|
||||
resolve :
|
||||
reject)(response);
|
||||
|
||||
@@ -80,7 +80,7 @@ module.exports = function xhrAdapter(resolve, reject, config) {
|
||||
}
|
||||
|
||||
// Add headers to the request
|
||||
if ("setRequestHeader" in request) {
|
||||
if ('setRequestHeader' in request) {
|
||||
utils.forEach(requestHeaders, function setRequestHeader(val, key) {
|
||||
if (!requestData && key.toLowerCase() === 'content-type') {
|
||||
// Remove Content-Type if data is undefined
|
||||
|
||||
Reference in New Issue
Block a user