简体   繁体   English

我可以使用CORS来限制域和该域中的子文件夹吗?

[英]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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM