Access-Control-Allow-Origin Multiple Origin Domains?

前端 未结 30 2090
隐瞒了意图╮
隐瞒了意图╮ 2020-11-21 07:08

Is there a way to allow multiple cross-domains using the Access-Control-Allow-Origin header?

I\'m aware of the *, but it is too open. I rea

30条回答
  •  时光说笑
    2020-11-21 07:26

    We can also set this in Global.asax file for Asp.net application.

    protected void Application_BeginRequest(object sender, EventArgs e)
        {
    
        // enable CORS
        HttpContext.Current.Response.AddHeader("Access-Control-Allow-Origin", "https://www.youtube.com");
    
        }
    

提交回复
热议问题