CORS 和 websocket 来源允许列表匹配不固定的域名,因此 'https://example.com' 也允许 'https://example.com.evil.net'
作者: lbellows创建于 2026年9月17日更新于 2026年9月17日
两个源允许列都使用 regexp.MustCompile 编译配置项,并使用 MatchString 进行匹配,除非操作员记得锚定:
auth/cors.go:45→compileAllowedCORSOrigins,由AllowOriginFunc使用api/stream/stream.go:183→compileAllowedWebSocketOrigins,由Upgrader.CheckOrigin使用
内容来源: gotify/server