We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
CORS_ALLOW_ORIGIN
localhost
127.0.0.1
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
我的个人博客(开源项目)中配置了 Twikoo 的实例地址,通过设置 CORS_ALLOW_ORIGIN 限制来源。近期发现自己的 Twikoo 实例被其他人本地测试时调用,CORS_ALLOW_ORIGIN 配置未生效。
通过阅读源码发现,即使明确配置了 CORS_ALLOW_ORIGIN,Twikoo 仍会强制放行 localhost、127.0.0.1 等本地地址。若用户希望通过 CORS_ALLOW_ORIGIN 严格限制调用来源,本地测试地址的强制放行会绕过预期限制。当用户主动配置 CORS 时,框架应尊重配置而非默认覆盖。
建议解决方案 移除对本地地址的强制放行逻辑,或通过新增配置项(如 CORS_FORCE_ALLOW_LOCALHOST=false)允许用户关闭此行为。
CORS_FORCE_ALLOW_LOCALHOST=false
附加信息
1.6.40
The text was updated successfully, but these errors were encountered:
Sorry, something went wrong.
No branches or pull requests
我的个人博客(开源项目)中配置了 Twikoo 的实例地址,通过设置
CORS_ALLOW_ORIGIN
限制来源。近期发现自己的 Twikoo 实例被其他人本地测试时调用,CORS_ALLOW_ORIGIN
配置未生效。通过阅读源码发现,即使明确配置了
CORS_ALLOW_ORIGIN
,Twikoo 仍会强制放行localhost
、127.0.0.1
等本地地址。若用户希望通过CORS_ALLOW_ORIGIN
严格限制调用来源,本地测试地址的强制放行会绕过预期限制。当用户主动配置 CORS 时,框架应尊重配置而非默认覆盖。建议解决方案
移除对本地地址的强制放行逻辑,或通过新增配置项(如
CORS_FORCE_ALLOW_LOCALHOST=false
)允许用户关闭此行为。附加信息
1.6.40
,部署方式 Vercel。The text was updated successfully, but these errors were encountered: