Azure Storage Blob: set CORS on the blobs level?

我们两清 提交于 2019-12-11 13:09:28

问题


Currently, we have set CORS for the whole container with:

azure storage cors set --blob static --cors '[{"AllowedOrigins":"*","AllowedMethods":"GET","MaxAgeInSeconds":"86400"}]'

Is there any possibility to set rule directly and separately for each blob in that container?

E.g. - for static/images/pic.png set "AllowedOrigins":"*" but for static/css/style.css - set "AllowedOrigins":"google.com"?


回答1:


Is there any possibility to set rule directly and separately for each blob in that container?

Unfortunately no. The way I understand CORS is that it somehow enables trust between 2 domains. With Azure Storage, the domains are by service (e.g. youraccount.blob.core.windows.net etc.). Thus the CORS rules are set at the service level.



来源:https://stackoverflow.com/questions/36543488/azure-storage-blob-set-cors-on-the-blobs-level

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!