Fix embed params regex again
This commit is contained in:
parent
c7a23058c8
commit
e37a6c66be
1 changed files with 4 additions and 2 deletions
|
@ -120,8 +120,10 @@ async function getOEmbed(ctx) {
|
||||||
const embedlyReferrer = getParameterByName('referrer', requestUrl);
|
const embedlyReferrer = getParameterByName('referrer', requestUrl);
|
||||||
|
|
||||||
const decodedQueryUri = decodeURIComponent(urlQuery);
|
const decodedQueryUri = decodeURIComponent(urlQuery);
|
||||||
const hasUrlParams = RegExp(/[?&]\w=/).test(decodedQueryUri);
|
|
||||||
const claimUrl = hasUrlParams ? decodedQueryUri.substring(0, decodedQueryUri.search(/[?&](?:\w=)?/)) : decodedQueryUri;
|
const paramsRegex = /[?&](?:\w=)?/g;
|
||||||
|
const hasUrlParams = RegExp(paramsRegex).test(decodedQueryUri);
|
||||||
|
const claimUrl = hasUrlParams ? decodedQueryUri.substring(0, decodedQueryUri.search(paramsRegex)) : decodedQueryUri;
|
||||||
|
|
||||||
const { claim, error } = await getClaim(claimUrl);
|
const { claim, error } = await getClaim(claimUrl);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue