[英]Can I use CORS to restrict both domain and subfolder in that domain?
I would like to restrict, for example, requests that come only from: box.com/my.point
vs entire of box.com
我想限制例如仅来自
box.com/my.point
与整个box.com
Is there a way with CORS to also control subfolder origin? CORS是否可以控制子文件夹的来源?
By definition, Origin
does not contain the path . 根据定义,
Origin
不包含path 。
You can implement a proprietary solution based on Referer
header, but it might not be respected by all the clients as it will be proprietary. 您可以基于
Referer
标头实现专有的解决方案,但由于它是专有的,因此并非所有客户端都可以尊重。 (Check Referer
and reply the CORS headers only if it matches your path.) (选中“
Referer
并仅在与您的路径匹配时答复CORS标头。)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.