- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
情况:
每当您在 中访问此 URL 时 Safari https://nvm.samengroen.com/plan/basic/497并在控制台中查看有关 XMLHttpRequest
的错误和 access control checks
.
奇怪的是,当我打开开发者工具并重新加载页面时,它工作正常。
有人可以澄清为什么它可以与打开的开发人员工具一起使用。以及可能导致此问题的原因。
信息:
该项目由 Angular
组成前端 (nvm.samengroen.com) 和 API-Platform
Symfony
后端(broker-api.samengroen.com)。它们都在同一个通配符 SSL 证书上,我发现这可能是答案,但是登录并查看从 API 获取数据的其他页面没有任何问题。
我们还在 .env
中进行了尝试。文件,没有任何结果:
###> nelmio/cors-bundle ###
CORS_ALLOW_ORIGIN=^https?://.*?$
###< nelmio/cors-bundle ###
到目前为止我的发现:
google tells me this would probably be because of a combination of
- HTTP/2 capable browsers
- multiple domain certificate (probably a wildcard cert)
- at some point apache wants to renegotiate the TLS which is not supported in the client implementation of http/2
Your server needs to reply to the OPTIONS http method. Not only to GET/POST/PUT/DELETE. Safari silently requests this hidden in the background. You can discover this with a MITM-attack on the connection
AH02032: Hostname nvm.samengroen.com provided via SNI and hostname broker-api.samengroen.com provided via HTTP have no compatible SSL setup, referer: https://nvm.samengroen.com/plan/basic/497
似乎它确实与 SSL 证书和可能的通配符有关。
最佳答案
请将此配置添加到您的nelmio_cors.yaml
在配置中。
nelmio_cors:
defaults:
origin_regex: true
allow_origin: ['*']
allow_methods: ['GET', 'OPTIONS', 'POST', 'PUT', 'PATCH', 'DELETE']
allow_headers: ['Content-Type']
expose_headers: ['Link']
max_age: 3600
paths:
'^/api/':
allow_origin: ['*']
allow_headers: ['*']
allow_methods: ['OPTIONS','POST', 'PUT', 'GET', 'DELETE', 'PATCH']
max_age: 3600
在这里,我们允许
OPTIONS
请求也是如此。
Note: I am assuming you have all your api's at a prefix of
/api/
for all routes
关于symfony - Safari - 由于访问控制检查,XMLHttpRequest 无法加载 X。 [检查员],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62789513/
我对Spark Inspector感兴趣,但我不能在试用模式下使用它。我安装了最新版本。然后我使用了框架设置助手,但它没有帮助。建筑设置正确 - 我按照以下说明逐步检查:http://www.spar
我正在尝试实例化一个在敌人死亡时出现的硬币预制件。 为了最初获得对预制件的引用,我使用它的标签检索了它: private GameObject coinSpawn; Start(){ coin
情况: 每当您在 中访问此 URL 时 Safari https://nvm.samengroen.com/plan/basic/497并在控制台中查看有关 XMLHttpRequest 的错误和 a
我是一名优秀的程序员,十分优秀!