mirror of
https://github.com/tenrok/axios.git
synced 2026-06-11 18:02:32 +03:00
Fixing building url with hash mark (#1771)
This commit fix building url with hash map (fragment identifier) when parameters are present: they must not be added after `#`, because client cut everything after `#`
This commit is contained in:
committed by
Khaled Garbaya
parent
21ae22dbd3
commit
81eaa3db4c
@@ -59,6 +59,11 @@ module.exports = function buildURL(url, params, paramsSerializer) {
|
||||
}
|
||||
|
||||
if (serializedParams) {
|
||||
var hashmarkIndex = url.indexOf('#');
|
||||
if (hashmarkIndex !== -1) {
|
||||
url = url.slice(0, hashmarkIndex);
|
||||
}
|
||||
|
||||
url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user