docs(cors): X-API-Version 明确为 advisory 惯例头(E1) — 消除版本协商假象
CI / Backend (build / vet / test / cross-compile) (push) Has been cancelled
CI / Frontend (tsc + vite build) (push) Has been cancelled

- middleware: CORS Allow-Headers 加 X-API-Version(跨域客户端不再预检失败)
- api-reference §0.2 + api-client §4.1: 声明服务端不校验、不据此协商版本
- 后端/前端零行为改动(前端仍在发,现CORS放行)
This commit is contained in:
AskaEth committed 2026-09-08 21:24:36 +08:00
1 parent 99f222761e
commit 3fc10fb86f
3 files changed
+4 -4

No files matched your search

+1 -1
View File
@@ -24,7 +24,7 @@ func (s *Server) cors(next http.Handler) http.Handler {
}
w.Header().Set("Vary", "Origin")
w.Header().Set("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS")
w.Header().Set("Access-Control-Allow-Headers", "Authorization, Content-Type")
w.Header().Set("Access-Control-Allow-Headers", "Authorization, Content-Type, X-API-Version")
w.Header().Set("Access-Control-Expose-Headers", voiceProviderHeader)
w.Header().Set("Access-Control-Max-Age", "600")
}