mirror of
https://github.com/tenrok/axios.git
synced 2026-06-14 18:42:33 +03:00
Fix merging of params (#2656)
* Name function to avoid ESLint func-names warning * Switch params config to merge list and update tests * Restore testing of both false and null * Restore test cases for keys without defaults * Include test for non-object values that aren't false-y.
This commit is contained in:
@@ -20,7 +20,7 @@ module.exports = function enhanceError(error, config, code, request, response) {
|
||||
error.response = response;
|
||||
error.isAxiosError = true;
|
||||
|
||||
error.toJSON = function() {
|
||||
error.toJSON = function toJSON() {
|
||||
return {
|
||||
// Standard
|
||||
message: this.message,
|
||||
|
||||
@@ -15,8 +15,8 @@ module.exports = function mergeConfig(config1, config2) {
|
||||
config2 = config2 || {};
|
||||
var config = {};
|
||||
|
||||
var valueFromConfig2Keys = ['url', 'method', 'params', 'data'];
|
||||
var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy'];
|
||||
var valueFromConfig2Keys = ['url', 'method', 'data'];
|
||||
var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params'];
|
||||
var defaultToConfig2Keys = [
|
||||
'baseURL', 'url', 'transformRequest', 'transformResponse', 'paramsSerializer',
|
||||
'timeout', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',
|
||||
|
||||
Reference in New Issue
Block a user