Class SiteAwareCorsConfigurationSource

  • All Implemented Interfaces:
    org.springframework.web.cors.CorsConfigurationSource

    public class SiteAwareCorsConfigurationSource
    extends Object
    implements org.springframework.web.cors.CorsConfigurationSource
    Implementation of CorsConfigurationSource that uses the current site configuration
    Since:
    3.1.11
    Author:
    joseross
    • Constructor Detail

      • SiteAwareCorsConfigurationSource

        @ConstructorProperties("cacheTemplate")
        public SiteAwareCorsConfigurationSource​(org.craftercms.core.util.cache.CacheTemplate cacheTemplate)
    • Method Detail

      • getCorsConfiguration

        public org.springframework.web.cors.CorsConfiguration getCorsConfiguration​(javax.servlet.http.HttpServletRequest request)
        Specified by:
        getCorsConfiguration in interface org.springframework.web.cors.CorsConfigurationSource
      • getConfiguration

        protected org.springframework.web.cors.CorsConfiguration getConfiguration​(org.apache.commons.configuration2.HierarchicalConfiguration<?> corsConfig)
      • getValues

        protected List<String> getValues​(org.apache.commons.configuration2.HierarchicalConfiguration<?> config,
                                         String key,
                                         String defaultValue)
      • getOrigins

        protected List<String> getOrigins​(org.apache.commons.configuration2.HierarchicalConfiguration<?> config)