在响应中添加来自请求的源头到访问控制
我想允许所有rigins从我的Apache服务器获取资源。
而不是添加:
Access-Control-Allow-Origin: *
我希望我的服务器可以通过以下特殊的响应来制作:
Access-Control-Allow-Origin: <the value of the Origin received in the request>
我可以添加到httpd.conf的东西来实现这一目标吗?
I'd like to allow all origins to fetch resources from my apache server.
Instead of adding:
Access-Control-Allow-Origin: *
I would like my server to craft a special response with :
Access-Control-Allow-Origin: <the value of the Origin received in the request>
Is there something I can add to httpd.conf to achieve this ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
似乎可以通过添加这两条线来实现:
正则差距意味着除了newline,Tab和Space以外的任何内容,因此只要原点不为空,将其添加到响应标头中。
Seems it can be achieved by adding those two lines:
The regex pretty much means anything except newline, tab, and space, so as long as the Origin is not empty add it to the response header.