@highpoint/js-fetch
Advanced tools
Comparing version 0.1.0 to 0.1.1
# v0.1.0 | ||
* Initial release | ||
# v0.1.1 | ||
* Automatically add `postDataBin=y` to JSON requests (if it's not already there) |
@@ -99,4 +99,3 @@ 'use strict'; | ||
headers: _extends({ | ||
'X-CSRF-Token': getCookieValue('CSRFToken') | ||
}, headers) | ||
'X-CSRF-Token': getCookieValue('CSRFToken') }, headers) | ||
}, otherArgs)); | ||
@@ -119,2 +118,9 @@ }; | ||
// Set postDataBin if it has not already been set | ||
var getBinaryURL = function getBinaryURL(url) { | ||
if (/[?&]postDataBin=/.test(url)) return url; | ||
var separator = url.indexOf('?') === -1 ? '?' : '&'; | ||
return url + separator + 'postDataBin=y'; | ||
}; | ||
var doJSONPost = function doJSONPost(url) { | ||
@@ -127,3 +133,3 @@ var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
return doPost(url, _extends({ | ||
return doPost(getBinaryURL(url), _extends({ | ||
headers: _extends({ | ||
@@ -130,0 +136,0 @@ 'Content-Type': 'application/json' |
{ | ||
"name": "@highpoint/js-fetch", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "HighPoint Fetch Library", | ||
@@ -5,0 +5,0 @@ "main": "dist/js-fetch.js", |
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
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
11048
5
182
1
72