46.3 CORS支持

跨域资源共享(CORS)是一个W3C规范,用于以灵活的方式指定跨域请求的认证类型,执行器的MVC端点也可以配置成支持该场景。

CORS支持默认是禁用的,只有在endpoints.cors.allowed-origins属性设置时才启用。以下配置允许来自example.com域的GETPOST调用:

endpoints.cors.allowed-origins=http://example.com
endpoints.cors.allowed-methods=GET,POST

查看EndpointCorsProperties获取完整的配置选项列表。

Last updated