mirror of
https://github.com/arfct/itty-bitty.git
synced 2026-03-11 08:54:33 +00:00
Update metadata.js
This commit is contained in:
parent
1a78d6c244
commit
43ddd710ee
1 changed files with 2 additions and 2 deletions
|
|
@ -37,12 +37,12 @@ export default async (request, context) => {
|
|||
let geo = context?.geo?.city + ", " + context?.geo?.subdivision?.code + ", " + context?.geo?.country?.code
|
||||
|
||||
let uaArray = Deno.env.get("UA_ARRAY")?.split(",") || [];
|
||||
let uaMatch = uaArray.some(a => ua.indexOf(a) != -1);
|
||||
let uaMatch = uaArray.some(a => ua?.indexOf(a) != -1);
|
||||
if (uaMatch) { return new Response('', { status: 401 }); }
|
||||
|
||||
if (path != "/" ) {
|
||||
let metadataBots = [ "Twitterbot", "curl", "facebookexternalhit", "Slackbot-LinkExpanding", "Discordbot", "snapchat", "Googlebot"]
|
||||
let isMetadataBot = metadataBots.some(bot => ua.indexOf(bot) != -1);
|
||||
let isMetadataBot = metadataBots.some(bot => ua?.indexOf(bot) != -1);
|
||||
|
||||
if (isMetadataBot && path.endsWith("/")) {
|
||||
let info = pathToMetadata(path)
|
||||
|
|
|
|||
Loading…
Reference in a new issue