Fix Regex for claimUrl embed url params

This commit is contained in:
Rafael 2022-02-01 09:31:42 -03:00 committed by Thomas Zarebczan
parent e9a003328d
commit e1b6c5149a

View file

@ -121,7 +121,7 @@ async function getOEmbed(ctx) {
const decodedQueryUri = decodeURIComponent(urlQuery); const decodedQueryUri = decodeURIComponent(urlQuery);
const hasUrlParams = RegExp(/[?&]\w=/).test(decodedQueryUri); const hasUrlParams = RegExp(/[?&]\w=/).test(decodedQueryUri);
const claimUrl = hasUrlParams ? decodedQueryUri.substring(0, decodedQueryUri.search(/[?&]\w=/)) : decodedQueryUri; const claimUrl = hasUrlParams ? decodedQueryUri.substring(0, decodedQueryUri.search(/[?&](?:\w=)?/)) : decodedQueryUri;
const { claim, error } = await getClaim(claimUrl); const { claim, error } = await getClaim(claimUrl);