Encode rpc=<url> param (#3751)
This commit is contained in:
parent
be0613ad1e
commit
b0379d4cd4
@ -194,7 +194,7 @@ function Endpoints ({ className = '', offset, onClose }: Props): React.ReactElem
|
||||
(): void => {
|
||||
uiSettings.set({ ...(uiSettings.get()), apiUrl });
|
||||
|
||||
window.location.assign(`${window.location.origin}${window.location.pathname}?rpc=${apiUrl}${window.location.hash}`);
|
||||
window.location.assign(`${window.location.origin}${window.location.pathname}?rpc=${encodeURIComponent(apiUrl)}${window.location.hash}`);
|
||||
// window.location.reload();
|
||||
|
||||
onClose();
|
||||
|
||||
@ -18,7 +18,8 @@ function getApiUrl (): string {
|
||||
if (urlOptions.rpc) {
|
||||
assert(!Array.isArray(urlOptions.rpc), 'Invalid WS endpoint specified');
|
||||
|
||||
const url = urlOptions.rpc.split('#')[0]; // https://polkadot.js.org/apps/?rpc=ws://127.0.0.1:9944#/explorer;
|
||||
// https://polkadot.js.org/apps/?rpc=ws://127.0.0.1:9944#/explorer;
|
||||
const url = decodeURIComponent(urlOptions.rpc.split('#')[0]);
|
||||
|
||||
assert(url.startsWith('ws://') || url.startsWith('wss://'), 'Non-prefixed ws/wss url');
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user