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:
parent
60743cdcdf
commit
190a0131d4
2 changed files with 2 additions and 2 deletions
|
@ -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];
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ const apiVar = {
|
|||
},
|
||||
booleanOnly: ["isAudioOnly", "isNoTTWatermark", "isTTFullAudio", "isAudioMuted", "dubLang", "vimeoDash", "disableMetadata"]
|
||||
}
|
||||
const forbiddenChars = ['}', '{', '(', ')', '\\', '%', '>', '<', '^', '*', '!', '~', ';', ':', ',', '`', '[', ']', '#', '$', '"', "'", "@", '=='];
|
||||
const forbiddenChars = ['}', '{', '(', ')', '\\', '>', '<', '^', '*', '!', '~', ';', ':', ',', '`', '[', ']', '#', '$', '"', "'", "@", '=='];
|
||||
const forbiddenCharsString = ['}', '{', '%', '>', '<', '^', ';', '`', '$', '"', "@", '='];
|
||||
|
||||
export function apiJSON(type, obj) {
|
||||
|
|
Loading…
Reference in a new issue