Skip to content

IIS HttpModule allowing for configuration of site CORS restrictions on a per-domain basis

License

Notifications You must be signed in to change notification settings

james-ralston/CORS.Net-HttpModule

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CORS.Net-HttpModule

Http Module for enabling multiple specific domains with Cross-origin resource sharing. It also allows for specific verbs and whether or not to accept credentials for each site enabled. To Add this to your project you just need to build the solution and add the assembly to the bin folder of the IIS directory for the site. Then you need add the following to the web config

<configuration>
  <configSections>
    <section name="cors" type="CORS.net_HttpModule.Congifuration.CorsConfig, CorsModule" requirePermission="false"/>
    <!-- other customer config sections -->
  </configSections>
  <cors>
    <sites>
      <site url="http://AllowedOrigin.com" verbs="GET,PUT,POST,DELETE,HEAD,PATCH,OPTIONS" />
      <site url="http://AllowedOrigin2.com" verbs="GET" allowCredentials="true" />
    </sites>
  </cors>
  <system.webServer>
    <modules>
      <add name="CorsModule" type="CORS.net_HttpModule.CorsModule, CorsModule" preCondition="managedHandler"/>
      <!-- other modules -->
    </modules>
    <!-- other settings -->
  </system.webServer>
  <!-- Other sections -->
<configuration>

About

IIS HttpModule allowing for configuration of site CORS restrictions on a per-domain basis

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages