Spaces:
Running
Running
JOHN SILLVESTOR commited on
fix build: drop brand.png from image
Browse files
server.js
CHANGED
|
@@ -89,7 +89,7 @@ const PLANS = {
|
|
| 89 |
};
|
| 90 |
const HOME_URL = "https://dublk20000.blogspot.com/";
|
| 91 |
const BRAND_FILE = path.join(__dirname, "brand.png");
|
| 92 |
-
const BRAND_URL =
|
| 93 |
|
| 94 |
const deriveKey = STREAM_SECRET
|
| 95 |
? (info) => crypto.hkdfSync("sha256", Buffer.from(STREAM_SECRET, "utf8"), Buffer.from("dublk2000"), Buffer.from(info), 32)
|
|
@@ -3351,8 +3351,10 @@ async function onReq(req, res) {
|
|
| 3351 |
try {
|
| 3352 |
if (url.pathname === "/") return handleHome(req, res);
|
| 3353 |
if (url.pathname === "/health") return handleHealth(req, res);
|
| 3354 |
-
if (url.pathname
|
| 3355 |
-
|
|
|
|
|
|
|
| 3356 |
if (url.pathname === "/public/bootstrap") return handleBootstrap(req, res, url);
|
| 3357 |
if (url.pathname === "/admin/tg-meta" && (req.method === "GET" || req.method === "POST")) return handleTgMeta(req, res, url);
|
| 3358 |
if ((url.pathname === "/t" || url.pathname === "/generate-token") && (req.method === "GET" || req.method === "POST")) return handleGenerate(req, res, url);
|
|
|
|
| 89 |
};
|
| 90 |
const HOME_URL = "https://dublk20000.blogspot.com/";
|
| 91 |
const BRAND_FILE = path.join(__dirname, "brand.png");
|
| 92 |
+
const BRAND_URL = "https://dublk2000.pages.dev/assets/brand-mark.png";
|
| 93 |
|
| 94 |
const deriveKey = STREAM_SECRET
|
| 95 |
? (info) => crypto.hkdfSync("sha256", Buffer.from(STREAM_SECRET, "utf8"), Buffer.from("dublk2000"), Buffer.from(info), 32)
|
|
|
|
| 3351 |
try {
|
| 3352 |
if (url.pathname === "/") return handleHome(req, res);
|
| 3353 |
if (url.pathname === "/health") return handleHealth(req, res);
|
| 3354 |
+
if (url.pathname === "/public/brand.png" && (req.method === "GET" || req.method === "HEAD")) {
|
| 3355 |
+
res.writeHead(302, { Location: BRAND_URL, "Cache-Control": "no-store" });
|
| 3356 |
+
return res.end();
|
| 3357 |
+
}
|
| 3358 |
if (url.pathname === "/public/bootstrap") return handleBootstrap(req, res, url);
|
| 3359 |
if (url.pathname === "/admin/tg-meta" && (req.method === "GET" || req.method === "POST")) return handleTgMeta(req, res, url);
|
| 3360 |
if ((url.pathname === "/t" || url.pathname === "/generate-token") && (req.method === "GET" || req.method === "POST")) return handleGenerate(req, res, url);
|