Class AccessControlAllowOriginHeaderSupplier

java.lang.Object
ch.tocco.nice2.web.core.impl.servlet.AccessControlAllowOriginHeaderSupplier
All Implemented Interfaces:
HeaderValueSupplier

@Component public class AccessControlAllowOriginHeaderSupplier extends Object implements HeaderValueSupplier
If used as service AllowedRequestOrigins can be set through an application property. example: nice2.web.allowedRequestOrigins=http://localhost:3000,https://tocco.github.io
  • Constructor Details

    • AccessControlAllowOriginHeaderSupplier

      public AccessControlAllowOriginHeaderSupplier()
  • Method Details

    • getHeaderValue

      @Nullable public @Nullable String getHeaderValue(jakarta.servlet.http.HttpServletRequest request)
      Specified by:
      getHeaderValue in interface HeaderValueSupplier
    • setAllowedRequestOrigins

      @Value("${nice2.web.allowedRequestOrigins}") public void setAllowedRequestOrigins(String allowedRequestOrigins)