Skip to content

在路由组上注册跨域中间件时,复杂跨域请求会报CORS策略阻止错误。 #250

@cognidim

Description

@cognidim

在路由组上注册跨域中间件时。如 iweb.HttpServer.Group("/api").Use(cors.New("")) 。
当进行简单跨域请求时一切正常。

当进行复杂跨域请求时。用iweb.HttpServer.SetEnabledAutoOPTIONS(true)自动注册OPTIONS请求。会提示已被CORS策略阻止错误。
如果手动注册OPTIONS请求时一切正常。如 apiGroup.OPTIONS(”/app“, dotweb.DefaultAutoOPTIONSHandler)。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions