Created
          January 8, 2018 16:41 
        
      - 
      
 - 
        
Save greggnakamura/fd188549219953d2b1ae071e2b66102a to your computer and use it in GitHub Desktop.  
    web.config: Multiple `Access-Control-Allow-Origin` values
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <!-- https://stackoverflow.com/questions/17323350/access-control-allow-origin-with-multiple-domains --> | |
| <httpProtocol> | |
| <customHeaders> | |
| <add name="Access-Control-Allow-Headers" value="Origin, X-Requested-With, Content-Type, Accept" /> | |
| <add name="Access-Control-Allow-Methods" value="POST,GET,OPTIONS,PUT,DELETE" /> | |
| </customHeaders> | |
| </httpProtocol> | |
| <rewrite> | |
| <outboundRules> | |
| <clear /> | |
| <rule name="AddCrossDomainHeader"> | |
| <match serverVariable="RESPONSE_Access_Control_Allow_Origin" pattern=".*" /> | |
| <conditions logicalGrouping="MatchAll" trackAllCaptures="true"> | |
| <add input="{HTTP_ORIGIN}" pattern="(http(s)?://((.+\.)?arbfile\.org|wwwqa01\.arbfile\.org|wwwdev01\.arbfile\.org))" /> | |
| </conditions> | |
| <action type="Rewrite" value="{C:0}" /> | |
| </rule> | |
| </outboundRules> | |
| </rewrite> | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment