/*    */ package com.picc.grab.config;
/*    */ 
/*    */ import org.springframework.context.annotation.Bean;
/*    */ import org.springframework.context.annotation.Configuration;
/*    */ import org.springframework.web.cors.CorsConfiguration;
/*    */ import org.springframework.web.cors.CorsConfigurationSource;
/*    */ import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
/*    */ import org.springframework.web.filter.CorsFilter;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ @Configuration
/*    */ public class CorsConfig
/*    */ {
/*    */   private CorsConfiguration buildConfig() {
/* 17 */     CorsConfiguration corsConfiguration = new CorsConfiguration();
/* 18 */     corsConfiguration.addAllowedOrigin("*");
/* 19 */     corsConfiguration.addAllowedHeader("*");
/* 20 */     corsConfiguration.addAllowedMethod("*");
/* 21 */     corsConfiguration.setMaxAge(Long.valueOf(3600L));
/* 22 */     corsConfiguration.setAllowCredentials(Boolean.valueOf(true));
/* 23 */     return corsConfiguration;
/*    */   }
/*    */   
/*    */   @Bean
/*    */   public CorsFilter corsFilter() {
/* 28 */     UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
/* 29 */     CorsConfiguration corsConfiguration = buildConfig();
/* 30 */     source.registerCorsConfiguration("/**", corsConfiguration);
/* 31 */     return new CorsFilter((CorsConfigurationSource)source);
/*    */   }
/*    */ }


/* Location:              C:\Users\Administrator\Desktop\ROOT\WEB-INF\classes\!\com\picc\grab\config\CorsConfig.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */