Skip to content

Spring filters which enables CORS header based configurable domains

Notifications You must be signed in to change notification settings

predix/spring-cors-filter

Repository files navigation

Spring CORS Filter

This project provides a spring filter to enable CORS.

##LICENSE

This project is licensed under Apache v2.

##Build

mvn clean package

Run Integration Tests

mvn clean verify

Setup

  • Add maven pom dependency in the client service:
	<dependency>
            <groupId>com.ge.predix</groupId>
            <artifactId>spring-cors-filter</artifactId>
            <version>2.0.0</version>
        </dependency>
  • Configure properties:
cors.xhr.allowed.uris=<<put value here like...^/v2/api-docs$>>
cors.xhr.allowed.origins=<<put value here like....^.*\\.example\\.domain\\.ge\\.com$,^.*\\.predix\\.io$>>
cors.xhr.allowed.headers=<<put value here like...Origin,Accept,X-Requested-With,Content-Type,Access-Control-Request-Method,
Access-Control-Request-Headers,Authorization,username,data>>
cors.xhr.controlmaxage=<<put value here like...1728000L>>
cors.xhr.allowed.methods:<<put value here like...GET,OPTIONS>>
  • Add a @ComponentScan annotation with base package entry of "com.ge.predix.web.cors". Example:
@ComponentScan(basePackages = {"com.ge.predix.web.cors"})

About

Spring filters which enables CORS header based configurable domains

Resources

Stars

Watchers

Forks

Packages

No packages published