aboutsummaryrefslogtreecommitdiffstats
path: root/lib/app.ts
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-02-28 15:16:20 -0800
committerAdam Soltys <[email protected]>2026-02-28 15:16:20 -0800
commit32f01e3e328db0006a55c6324625b49d60244b66 (patch)
treeb97866549b919964957365e1e05681e85af7021a /lib/app.ts
parenta1632ae402d11fdd7ffc360de97c55e0b4fad677 (diff)
downloadcoinos-server-32f01e3e328db0006a55c6324625b49d60244b66.tar.gz
coinos-server-32f01e3e328db0006a55c6324625b49d60244b66.zip
fix typescript issues
Diffstat (limited to 'lib/app.ts')
-rw-r--r--lib/app.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/app.ts b/lib/app.ts
index ec810288..8dc1e106 100644
--- a/lib/app.ts
+++ b/lib/app.ts
@@ -30,7 +30,7 @@ app.use("*", async (c, next) => {
// Skip rate limiting for public assets
if (url.includes("public")) return next();
- const ip = (c.req.header("cf-connecting-ip") as string) || c.env?.ip || "unknown";
+ const ip = (c.req.header("cf-connecting-ip") as string) || (c.env as any)?.ip || "unknown";
const ua = c.req.header("user-agent") || "unknown-ua";
const rateLimitBy = c.req.header("rate-limit-by");
const key = rateLimitBy === "ua" ? ua : ip;
@@ -103,7 +103,7 @@ app.use("*", async (c, next) => {
if (shouldLog) {
const xff = c.req.header("x-forwarded-for");
const forwardedIp = xff?.split(",")[0]?.trim();
- const ip = c.req.header("cf-connecting-ip") || forwardedIp || c.env?.ip || "unknown";
+ const ip = c.req.header("cf-connecting-ip") || forwardedIp || (c.env as any)?.ip || "unknown";
let body;
// Only parse body for non-GET requests
@@ -119,7 +119,7 @@ app.use("*", async (c, next) => {
ip,
query: c.req.query(),
body,
- user: c.get("user")?.username,
+ user: (c.get("user" as never) as any)?.username,
});
}
@@ -141,7 +141,7 @@ app.use("*", async (c, next) => {
});
// Error handler
-app.onError((err, c) => {
+app.onError((_err, c) => {
return c.json({ ok: false }, 500);
});