【发布时间】:2014-01-07 18:45:00
【问题描述】:
当我想从 Angular 应用程序访问 DropWizard 服务器时,我遇到了问题。 错误是:
XMLHttpRequest cannot load https://localhost:8080/admin/metrics. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8000' is therefore not allowed access.
我已经看过这里了 Dropwizard resolving CORS issues
它实际上适用于以下地址:
https://localhost:8080/myResource/list
但不是预配置的 /admin 资源
https://localhost:8080/admin/metrics.
似乎表明添加到环境中的过滤器仅用于/api而不用于/admin ...
我需要帮助吗?
【问题讨论】:
标签: admin cors dropwizard