v0.1.22 — fix Internal Server Error on redirect: static hashIp import + resilient blocklist (no-op on schema miss)
This commit is contained in:
parent
a359e0852c
commit
c81114f44c
2 changed files with 2 additions and 2 deletions
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "corex-nexredirect",
|
||||
"version": "0.1.21",
|
||||
"version": "0.1.22",
|
||||
"license": "MIT",
|
||||
"overrides": {
|
||||
"postcss": "^8.5.13",
|
||||
|
|
|
|||
|
|
@ -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)) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue