Skip to content

CORS autoconfiguration

Erich Jagomägis edited this page Apr 4, 2024 · 2 revisions

Introducing CORS autoconfiguration, which enables CORS header and preflight request support.

Enabling feature

In order to enable the feature, following property should be added to application.properties file.

ee.bitweb.core.cors.auto-configuration=true

Library does not include any transitive dependencies, thus in order to use this feature, following dependencies should be included:

    implementation 'org.springframework.boot:spring-boot-starter-web'

Available configuration properties

Property Default value Description
ee.bitweb.core.cors.auto-configuration false Enables cors auto configuration
ee.bitweb.core.cors.path /** Path to which cors configuration applies
ee.bitweb.core.cors.allowCredentials true Used to allow browser to send credentials (cookies and csrf tokens).Adds Access-Control-Allow-Credentials header to response of preflight request.
ee.bitweb.core.cors.allowedOrigins   List of allowed origins
ee.bitweb.core.cors.allowedMethods GET, POST, PUT, DELETE, OPTIONS, PATCH List of allowed methods

Clone this wiki locally