Comparing version 1.2.0 to 1.2.1-beta1
@@ -27,2 +27,4 @@ 'use strict'; | ||
var FORM_URLENCODED = 'application/x-www-form-urlencoded'; | ||
function isJSONPRequest(options) { | ||
@@ -82,6 +84,7 @@ return options.dataType === 'jsonp'; | ||
var contentType = utils.getHeaderContentType(options.contentType, options.headers); | ||
utils.addEntry(axiosOptions, 'headers.content-type', contentType); | ||
if (method === 'get' || method === 'head') { | ||
utils.addEntry(axiosOptions, 'paramsSerializer', utils.stringifyQueryString); | ||
utils.addEntry(axiosOptions, 'params', options.data); | ||
utils.addEntry(axiosOptions, 'headers.content-type', contentType); | ||
} | ||
@@ -91,6 +94,6 @@ | ||
utils.addEntry(axiosOptions, 'data', options.data); | ||
utils.addEntry(axiosOptions, 'headers.content-type', contentType || 'application/x-www-form-urlencoded; charset=UTF-8'); | ||
// Pass to server as is for other content types | ||
if (axiosOptions.headers['content-type'].toLowerCase().indexOf('application/x-www-form-urlencoded') !== -1) { | ||
var _contentType = axiosOptions.headers['content-type'] || FORM_URLENCODED; | ||
if (_contentType.toLowerCase().indexOf(FORM_URLENCODED) !== -1) { | ||
utils.addEntry(axiosOptions, 'transformRequest', utils.stringifyQueryString); | ||
@@ -97,0 +100,0 @@ } |
{ | ||
"name": "zan-ajax", | ||
"version": "1.2.0", | ||
"version": "1.2.1-beta1", | ||
"description": "Promise based HTTP client for the browser and node", | ||
@@ -11,3 +11,3 @@ "main": "lib/index.js", | ||
"test": "npm run browserify:test && open test/index.html", | ||
"prepublish": "npm run lint && npm run build" | ||
"prepare": "npm run lint && npm run build" | ||
}, | ||
@@ -14,0 +14,0 @@ "types": "./typings/index.d.ts", |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
567
0
28652
2