api: url-encode UTF-8 characters in url
this encode-decode construct is ugly, but necessary to retain backwards compatibility for weirdos that encode the URL when passing it in via json ( like the frontend, for example. :/ )
This commit is contained in:
@@ -10,7 +10,7 @@ import hostOverrides from "./processing/hostOverrides.js";
|
||||
|
||||
export async function getJSON(originalURL, lang, obj) {
|
||||
try {
|
||||
let patternMatch, url = decodeURIComponent(originalURL),
|
||||
let patternMatch, url = encodeURI(decodeURIComponent(originalURL)),
|
||||
hostname = new URL(url).hostname.split('.'),
|
||||
host = hostname[hostname.length - 2];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user