enabling cross-origin resource sharing on IIS7

后端 未结 10 2172
轻奢々
轻奢々 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:51

    I found the information found at http://help.infragistics.com/Help/NetAdvantage/jQuery/2013.1/CLR4.0/html/igOlapXmlaDataSource_Configuring_IIS_for_Cross_Domain_OLAP_Data.html to be very helpful in setting up HTTP OPTIONS for a WCF service in IIS 7.

    I added the following to my web.config and then moved the OPTIONSVerbHandler in the IIS 7 'hander mappings' list to the top of the list. I also gave the OPTIONSVerbHander read access by double clicking the hander in the handler mappings section then on 'Request Restrictions' and then clicking on the access tab.

    Unfortunately I quickly found that IE doesn't seem to support adding headers to their XDomainRequest object (setting the Content-Type to text/xml and adding a SOAPAction header).

    Just wanted to share this as I spent the better part of a day looking for how to handle it.

    
        
            
                
                
                
            
        
    
    

提交回复
热议问题