mirror of
https://github.com/tenrok/axios.git
synced 2026-06-17 19:21:29 +03:00
Co-authored-by: Jay <jasonsaayman@gmail.com>
This commit is contained in:
@@ -16,9 +16,7 @@ function encode(val) {
|
||||
replace(/%3A/gi, ':').
|
||||
replace(/%24/g, '$').
|
||||
replace(/%2C/gi, ',').
|
||||
replace(/%20/g, '+').
|
||||
replace(/%5B/gi, '[').
|
||||
replace(/%5D/gi, ']');
|
||||
replace(/%20/g, '+');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -37,7 +37,7 @@ describe('helpers::buildURL', function () {
|
||||
foo: {
|
||||
bar: 'baz'
|
||||
}
|
||||
})).toEqual('/foo?foo[bar]=baz');
|
||||
})).toEqual('/foo?foo%5Bbar%5D=baz');
|
||||
});
|
||||
|
||||
it('should support date params', function () {
|
||||
@@ -48,10 +48,10 @@ describe('helpers::buildURL', function () {
|
||||
})).toEqual('/foo?date=' + date.toISOString());
|
||||
});
|
||||
|
||||
it('should support array params', function () {
|
||||
it('should support array params with encode', function () {
|
||||
expect(buildURL('/foo', {
|
||||
foo: ['bar', 'baz', null, undefined]
|
||||
})).toEqual('/foo?foo[]=bar&foo[]=baz');
|
||||
foo: ['bar', 'baz']
|
||||
})).toEqual('/foo?foo%5B%5D=bar&foo%5B%5D=baz');
|
||||
});
|
||||
|
||||
it('should support special char params', function () {
|
||||
|
||||
Reference in New Issue
Block a user