List of usage examples for org.springframework.web.cors CorsConfiguration setAllowedHeaders
public void setAllowedHeaders(@Nullable List<String> allowedHeaders)
From source file:org.ameba.http.PermitAllCorsConfigurationSource.java
/** * {@inheritDoc}// w w w .j av a 2s. c o m * * Returns a pre-configured configuration that allows everything from everywhere. */ @Override public CorsConfiguration getCorsConfiguration(HttpServletRequest request) { CorsConfiguration corsConfiguration = new CorsConfiguration(); corsConfiguration.addAllowedOrigin("*"); corsConfiguration.setAllowedMethods(asList("GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS")); corsConfiguration.setAllowedHeaders(asList("Content-Type", "X-REQUESTED-WITH", "Authorization")); corsConfiguration.setMaxAge(1800L); return corsConfiguration; }