修复bug
This commit is contained in:
1 parent
1850ac640e
commit
892ba5886d
20 files changed
+1078
-178
No files matched your search
@@ -18,6 +18,12 @@ import (
|
||||
|
||||
// 初始化路由(精简版)
|
||||
func init() {
|
||||
// 扫描器探针降噪:.env / config.js / credentials.json / Go 源码路径等探测请求不再逐条打印,
|
||||
// 全部 404 时只定期汇总「未发现泄露」,一旦返回 2xx 立即告警具体路径。
|
||||
// dev 模式的 `[D] router.go` 访问日志由 middleware 的 filterconsole 适配器过滤,
|
||||
// 这里保留 DefaultAccessLogFilter 仅用于 AccessLogs 开启的场景。
|
||||
beego.DefaultAccessLogFilter = middleware.NewSecurityProbeLogFilter(beego.DefaultAccessLogFilter)
|
||||
|
||||
// 全局 CORS 处理 + 预检请求
|
||||
// 注意:Allow-Origin 为 * 时不能同时设置 Allow-Credentials: true,否则浏览器会拒绝带 Authorization 的预检(上传/接口跨域常见现象)。
|
||||
// 当前 JWT 走 Header、前端 axios withCredentials=false,无需携带 Cookie,故不返回 Allow-Credentials。
|
||||
|
||||
Reference in new issue
Block a user