Closed longS2baobao closed 6 years ago
page.js line 167. var url = (hashbang && ~location.hash.indexOf('#!')) ? location.hash.substr(2) + location.search : location.pathname + location.search + location.hash;
I'm having problem with the above highlighted part. It keeps pending query string to the end of my url. I'm not sure if this is a bug.
Input: https://localhost:8551/?s=1
Processing code: const defaultRoute = 'MYPAGE' page('/', () => { page.redirect(defaultRoute); }); page(defaultRoute, () => {}); page.start({ hashbang: true, dispatch: true, popstate: false });
Output: First time: https://localhost:8551/?s=1#!MYPAGE After refresh: https://localhost:8551/?s=1#!MYPAGE?s=1 Refresh again: https://localhost:8551/?s=1#!MYPAGE?s=1?s=1
Oops, closed the wrong issue :P
I just tested and this does not occur any more. Only get the one query string as part of the URL.
Somehow this happens again in latest master: https://i.vgy.me/h0ytkR.webm
page.js line 167. var url = (hashbang && ~location.hash.indexOf('#!')) ? location.hash.substr(2) + location.search : location.pathname + location.search + location.hash;
I'm having problem with the above highlighted part. It keeps pending query string to the end of my url. I'm not sure if this is a bug.
Input: https://localhost:8551/?s=1
Processing code: const defaultRoute = 'MYPAGE' page('/', () => { page.redirect(defaultRoute); }); page(defaultRoute, () => {}); page.start({ hashbang: true, dispatch: true, popstate: false });
Output: First time: https://localhost:8551/?s=1#!MYPAGE After refresh: https://localhost:8551/?s=1#!MYPAGE?s=1 Refresh again: https://localhost:8551/?s=1#!MYPAGE?s=1?s=1