enabling cross-origin resource sharing on IIS7

后端 未结 10 2157
轻奢々
轻奢々 2020-11-22 15:22

I recently ran into with posting Javascript requests to another domain. By default XHR posting to other domains is not allowed.

Following the instructions from htt

10条回答
  •  春和景丽
    2020-11-22 15:38

    It took Microsoft years to identify the gaps and ship an out-of-band CORS module to solve this problem.

    1. Install the module from Microsoft
    2. Configure it with snippets

    as below

    
        
                        
                
            
        
    
    

    In general, it is much easier than your custom headers and also offers better handling of preflight requests.

    In case you need the same for IIS Express, use some PowerShell scripts I wrote.

提交回复
热议问题