axios 0.27.1 → 0.27.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,6 +10,7 @@ var isURLSameOrigin = require('./../helpers/isURLSameOrigin');
10
10
  var transitionalDefaults = require('../defaults/transitional');
11
11
  var AxiosError = require('../core/AxiosError');
12
12
  var CanceledError = require('../cancel/CanceledError');
13
+ var parseProtocol = require('../helpers/parseProtocol');
13
14
 
14
15
  module.exports = function xhrAdapter(config) {
15
16
  return new Promise(function dispatchXhrRequest(resolve, reject) {
@@ -27,6 +28,10 @@ module.exports = function xhrAdapter(config) {
27
28
  }
28
29
  }
29
30
 
31
+ if (utils.isFormData(requestData) && utils.isStandardBrowserEnv()) {
32
+ delete requestHeaders['Content-Type']; // Let the browser set it
33
+ }
34
+
30
35
  var request = new XMLHttpRequest();
31
36
 
32
37
  // HTTP basic authentication
@@ -203,8 +208,7 @@ module.exports = function xhrAdapter(config) {
203
208
  requestData = null;
204
209
  }
205
210
 
206
- var tokens = fullPath.split(':', 2);
207
- var protocol = tokens.length > 1 && tokens[0];
211
+ var protocol = parseProtocol(fullPath);
208
212
 
209
213
  if (protocol && [ 'http', 'https', 'file' ].indexOf(protocol) === -1) {
210
214
  reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));
package/lib/env/data.js CHANGED
@@ -1,3 +1,3 @@
1
1
  module.exports = {
2
- "version": "0.27.1"
2
+ "version": "0.27.2"
3
3
  };
@@ -0,0 +1,6 @@
1
+ 'use strict';
2
+
3
+ module.exports = function parseProtocol(url) {
4
+ var match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
5
+ return match && match[1] || '';
6
+ };
package/package.json CHANGED
@@ -1,16 +1,14 @@
1
1
  {
2
2
  "name": "axios",
3
- "version": "0.27.1",
3
+ "version": "0.27.2",
4
4
  "description": "Promise based HTTP client for the browser and node.js",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
7
7
  "scripts": {
8
8
  "test": "grunt test && dtslint",
9
9
  "start": "node ./sandbox/server.js",
10
- "build": "cross-env NODE_ENV=production grunt build",
11
10
  "preversion": "grunt version && npm test",
12
- "version": "npm run build && git add -A dist && git add CHANGELOG.md bower.json package.json",
13
- "postversion": "git push && git push --tags",
11
+ "build": "NODE_ENV=production grunt build",
14
12
  "examples": "node ./examples/server.js",
15
13
  "coveralls": "cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",
16
14
  "fix": "eslint --fix lib/**/*.js"
@@ -35,7 +33,6 @@
35
33
  "devDependencies": {
36
34
  "abortcontroller-polyfill": "^1.7.3",
37
35
  "coveralls": "^3.1.1",
38
- "cross-env": "^7.0.3",
39
36
  "dtslint": "^4.2.1",
40
37
  "es6-promise": "^4.2.8",
41
38
  "formidable": "^2.0.1",