mirror of
https://github.com/tenrok/axios.git
synced 2026-06-20 20:00:40 +03:00
Fixing special char encoding (#1671)
* removing @ character from replacement list since it is a reserved character * Updating buildURL test to not include the @ character * Removing console logs Co-authored-by: Jay <jasonsaayman@gmail.com>
This commit is contained in:
@@ -4,7 +4,6 @@ var utils = require('./../utils');
|
|||||||
|
|
||||||
function encode(val) {
|
function encode(val) {
|
||||||
return encodeURIComponent(val).
|
return encodeURIComponent(val).
|
||||||
replace(/%40/gi, '@').
|
|
||||||
replace(/%3A/gi, ':').
|
replace(/%3A/gi, ':').
|
||||||
replace(/%24/g, '$').
|
replace(/%24/g, '$').
|
||||||
replace(/%2C/gi, ',').
|
replace(/%2C/gi, ',').
|
||||||
|
|||||||
@@ -36,8 +36,8 @@ describe('helpers::buildURL', function () {
|
|||||||
|
|
||||||
it('should support special char params', function () {
|
it('should support special char params', function () {
|
||||||
expect(buildURL('/foo', {
|
expect(buildURL('/foo', {
|
||||||
foo: '@:$, '
|
foo: ':$, '
|
||||||
})).toEqual('/foo?foo=@:$,+');
|
})).toEqual('/foo?foo=:$,+');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should support existing params', function () {
|
it('should support existing params', function () {
|
||||||
|
|||||||
Reference in New Issue
Block a user