add always allow list
This commit is contained in:
9
index.js
9
index.js
@ -2,6 +2,12 @@ import { Database } from "bun:sqlite";
|
|||||||
import express from "express";
|
import express from "express";
|
||||||
const port = process.env.PORT || 3000;
|
const port = process.env.PORT || 3000;
|
||||||
|
|
||||||
|
const alwaysAllow = [
|
||||||
|
"selenite.cc",
|
||||||
|
"selenite.skys.day",
|
||||||
|
"selenite.skysthelimit.dev"
|
||||||
|
]
|
||||||
|
|
||||||
const db = new Database("links.sqlite");
|
const db = new Database("links.sqlite");
|
||||||
db.exec("PRAGMA journal_mode = WAL;");
|
db.exec("PRAGMA journal_mode = WAL;");
|
||||||
|
|
||||||
@ -64,6 +70,9 @@ app.get("/check", async (req, res) => {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
return res.status(400).end();
|
return res.status(400).end();
|
||||||
}
|
}
|
||||||
|
if(alwaysAllow.includes(domain.host)) {
|
||||||
|
return res.status(200).end();
|
||||||
|
}
|
||||||
|
|
||||||
const hostname = domain.hostname.toLowerCase();
|
const hostname = domain.hostname.toLowerCase();
|
||||||
if (hostname.split(".").length > 5) {
|
if (hostname.split(".").length > 5) {
|
||||||
|
|||||||
Reference in New Issue
Block a user