v0.1.22 — fix Internal Server Error on redirect: static hashIp import + resilient blocklist (no-op on schema miss)

This commit is contained in:
Hendrik 2026-05-01 21:44:44 +02:00
parent a359e0852c
commit c81114f44c
2 changed files with 2 additions and 2 deletions

View file

@ -1,6 +1,6 @@
{
"name": "corex-nexredirect",
"version": "0.1.21",
"version": "0.1.22",
"license": "MIT",
"overrides": {
"postcss": "^8.5.13",

View file

@ -12,6 +12,7 @@ import { recordHit, shouldRecord } from "./lib/hits";
import { renderSunsetPage } from "./lib/sunset-html";
import { isBlocked } from "./lib/blocklist";
import { startJobs } from "./lib/jobs";
import { hashIp } from "./lib/db";
const dev = process.env.NODE_ENV !== "production";
const port = parseInt(process.env.PORT || "3000", 10);
@ -36,7 +37,6 @@ app.prepare().then(() => {
"unknown";
const ua = (req.headers["user-agent"] as string) || null;
// Hash IP early so we can use it for the scan-detector check
const { hashIp } = await import("./lib/db");
const ipHash = hashIp(ip);
// Persistent blocklist: drop without recording or redirecting
if (isBlocked(ipHash)) {