diff options
| author | Adam Soltys <[email protected]> | 2026-02-28 15:16:20 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-02-28 15:16:20 -0800 |
| commit | 32f01e3e328db0006a55c6324625b49d60244b66 (patch) | |
| tree | b97866549b919964957365e1e05681e85af7021a /lib/app.ts | |
| parent | a1632ae402d11fdd7ffc360de97c55e0b4fad677 (diff) | |
| download | coinos-server-32f01e3e328db0006a55c6324625b49d60244b66.tar.gz coinos-server-32f01e3e328db0006a55c6324625b49d60244b66.zip | |
fix typescript issues
Diffstat (limited to 'lib/app.ts')
| -rw-r--r-- | lib/app.ts | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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); }); |
