Skip to content

Commit 1c92524

Browse files
committed
Fix broken unicode urls
It wasn't possible to create unicode based URLs in freeurl mode, because the noteid used for the websocket connection is double escaped. When we decode it and let socketio-client reencode it, we get the real shortid/noteid and can find the note in the database and open the connection. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
1 parent c7745f6 commit 1c92524

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

public/js/lib/config/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export const debug = window.debug || false
77
export const port = window.location.port
88
export const serverurl = `${window.location.protocol}//${domain || window.location.hostname}${port ? ':' + port : ''}${urlpath ? '/' + urlpath : ''}`
99
window.serverurl = serverurl
10-
export const noteid = urlpath ? window.location.pathname.slice(urlpath.length + 1, window.location.pathname.length).split('/')[1] : window.location.pathname.split('/')[1]
10+
export const noteid = decodeURIComponent(urlpath ? window.location.pathname.slice(urlpath.length + 1, window.location.pathname.length).split('/')[1] : window.location.pathname.split('/')[1])
1111
export const noteurl = `${serverurl}/${noteid}`
1212

1313
export const version = window.version

0 commit comments

Comments
 (0)