Skip to content

fix(auth): prevent apiKeyAuth middleware pollution in sub-routes#647

Open
icebear0828 wants to merge 1 commit into
devfrom
fix/api-key-auth-leak
Open

fix(auth): prevent apiKeyAuth middleware pollution in sub-routes#647
icebear0828 wants to merge 1 commit into
devfrom
fix/api-key-auth-leak

Conversation

@icebear0828

@icebear0828 icebear0828 commented Jun 6, 2026

Copy link
Copy Markdown
Owner

This PR fixes the apiKeyAuth middleware issue where mounting sub-routes to Hono under root path elevated the middleware to act globally, causing 401 leaks on non-API routes. Precised endpoint bindings are applied to replace global use("*") matches in routes/chat.ts, embeddings.ts, gemini.ts, messages.ts, and responses.ts.

Closes #653

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

错误请求数量太多,删除直接返回登录页面

1 participant