mirror of
https://github.com/tenrok/axios.git
synced 2026-06-08 17:22:34 +03:00
Fixed query params composing; (#5018)
* Fixes #4999; * Added regression test;
This commit is contained in:
@@ -301,9 +301,14 @@ export default function httpAdapter(config) {
|
||||
|
||||
auth && headers.delete('authorization');
|
||||
|
||||
const path = parsed.pathname.concat(parsed.searchParams);
|
||||
let path;
|
||||
|
||||
try {
|
||||
buildURL(path, config.params, config.paramsSerializer).replace(/^\?/, '');
|
||||
path = buildURL(
|
||||
parsed.pathname + parsed.search,
|
||||
config.params,
|
||||
config.paramsSerializer
|
||||
).replace(/^\?/, '');
|
||||
} catch (err) {
|
||||
const customErr = new Error(err.message);
|
||||
customErr.config = config;
|
||||
@@ -315,7 +320,7 @@ export default function httpAdapter(config) {
|
||||
headers.set('Accept-Encoding', 'gzip, deflate, br', false);
|
||||
|
||||
const options = {
|
||||
path: buildURL(path, config.params, config.paramsSerializer).replace(/^\?/, ''),
|
||||
path,
|
||||
method: method,
|
||||
headers: headers.toJSON(),
|
||||
agents: { http: config.httpAgent, https: config.httpsAgent },
|
||||
|
||||
Reference in New Issue
Block a user