fix: exclude telegram routes from x-custom-auth check (#780)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Dream Hunter
2025-12-11 22:18:20 +08:00
committed by GitHub
parent 7d485a7d0d
commit a25199eb34

View File

@@ -52,7 +52,7 @@ app.use('/*', async (c, next) => {
// check header x-custom-auth
const passwords = getPasswords(c);
if (!c.req.path.startsWith("/open_api") && passwords && passwords.length > 0) {
if (!c.req.path.startsWith("/open_api") && !c.req.path.startsWith("/telegram/") && passwords && passwords.length > 0) {
const auth = c.req.raw.headers.get("x-custom-auth");
if (!auth || !passwords.includes(auth)) {
return c.text(msgs.CustomAuthPasswordMsg, 401)