-
-
Notifications
You must be signed in to change notification settings - Fork 11.5k
Description
Describe the issue
The default behavior of paramsSerializer does not encode square brackets.
There cannot be brackets in place of the url parameter, and it should be encoded.
Looking at this pull request or this comment, This behavior seems to be intentional.
But according to the RFC 3986 cited there:
A host identified by an Internet Protocol literal address, version 6
[RFC3513] or later, is distinguished by enclosing the IP literal
within square brackets ("[" and "]"). This is the only place where
square bracket characters are allowed in the URI syntax.
(page 19)
URL parameter is not in this case. So I think brackets should be encoded in default behavior.
Example Code
axios.get('/test', {params: {a: '[]'}})Expected behavior, if applicable
expected : request URL is https://domain.com/test?a=%5B%5D
actual: request URL is https://domain.com/test?a=[]
Environment
- Axios Version: 0.20.0
- Browser: Chrome
- Browser Version: 85.0.4183.121