fix(server): exempt /global/health from auth middleware#12867
fix(server): exempt /global/health from auth middleware#12867Mr-Neutr0n wants to merge 1 commit into
Conversation
When OPENCODE_SERVER_PASSWORD is set, the auth middleware was applied to all routes including /global/health. Health check endpoints should be accessible without authentication so that monitoring tools and load balancers can verify the server is running. Skip the basicAuth check when the request path is /global/health. Fixes anomalyco#12805
|
Hey! Your PR title Please update it to start with one of:
Where See CONTRIBUTING.md for details. |
|
The following comment was made by an LLM, it may be inaccurate: No duplicate PRs found |
|
@Mr-Neutr0n Please fix to pass the tests🙏🙏🙏 |
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
Summary
OPENCODE_SERVER_PASSWORDis set, the Basic Auth middleware was applied to all routes, including/global/health. Health check endpoints should be publicly accessible so monitoring tools and load balancers can verify the server is running without needing credentials./global/health.Fixes #12805
Test plan
OPENCODE_SERVER_PASSWORDsetGET /global/healthreturns 200 without credentialsOPENCODE_SERVER_PASSWORDis setOPENCODE_SERVER_PASSWORDis not set