/** * Check the headers and determine the headers for the response of a * pre-flight request. The default implementation simply delegates to * {@link org.springframework.web.cors.CorsConfiguration#checkOrigin(String)}. */ @Nullable protected List<String> checkHeaders(CorsConfiguration config, List<String> requestHeaders) { return config.checkHeaders(requestHeaders); }
/** * Check the headers and determine the headers for the response of a * pre-flight request. The default implementation simply delegates to * {@link CorsConfiguration#checkOrigin(String)}. */ @Nullable protected List<String> checkHeaders(CorsConfiguration config, List<String> requestHeaders) { return config.checkHeaders(requestHeaders); }
/** * Check the headers and determine the headers for the response of a * pre-flight request. The default implementation simply delegates to * {@link CorsConfiguration#checkOrigin(String)}. */ @Nullable protected List<String> checkHeaders(CorsConfiguration config, List<String> requestHeaders) { return config.checkHeaders(requestHeaders); }
/** * Check the headers and determine the headers for the response of a * pre-flight request. The default implementation simply delegates to * {@link org.springframework.web.cors.CorsConfiguration#checkOrigin(String)}. */ @Nullable protected List<String> checkHeaders(CorsConfiguration config, List<String> requestHeaders) { return config.checkHeaders(requestHeaders); }
@Test public void checkHeadersAllowed() { CorsConfiguration config = new CorsConfiguration(); assertEquals(Collections.emptyList(), config.checkHeaders(Collections.emptyList())); config.addAllowedHeader("header1"); config.addAllowedHeader("header2"); assertEquals(Arrays.asList("header1"), config.checkHeaders(Arrays.asList("header1"))); assertEquals(Arrays.asList("header1", "header2"), config.checkHeaders(Arrays.asList("header1", "header2"))); assertEquals(Arrays.asList("header1", "header2"), config.checkHeaders(Arrays.asList("header1", "header2", "header3"))); }
@Test public void checkHeadersNotAllowed() { CorsConfiguration config = new CorsConfiguration(); assertNull(config.checkHeaders(null)); assertNull(config.checkHeaders(Arrays.asList("header1"))); config.setAllowedHeaders(Collections.emptyList()); assertNull(config.checkHeaders(Arrays.asList("header1"))); config.addAllowedHeader("header2"); config.addAllowedHeader("header3"); assertNull(config.checkHeaders(Arrays.asList("header1"))); }
/** * Check the headers and determine the headers for the response of a * pre-flight request. The default implementation simply delegates to * {@link org.springframework.web.cors.CorsConfiguration#checkOrigin(String)}. */ @Nullable protected List<String> checkHeaders(CorsConfiguration config, List<String> requestHeaders) { return config.checkHeaders(requestHeaders); }
/** * Check the headers and determine the headers for the response of a * pre-flight request. The default implementation simply delegates to * {@link org.springframework.web.cors.CorsConfiguration#checkOrigin(String)}. */ @Nullable protected List<String> checkHeaders(CorsConfiguration config, List<String> requestHeaders) { return config.checkHeaders(requestHeaders); }
/** * Check the headers and determine the headers for the response of a * pre-flight request. The default implementation simply delegates to * {@link CorsConfiguration#checkOrigin(String)}. */ @Nullable protected List<String> checkHeaders(CorsConfiguration config, List<String> requestHeaders) { return config.checkHeaders(requestHeaders); }
/** * Check the headers and determine the headers for the response of a * pre-flight request. The default implementation simply delegates to * {@link CorsConfiguration#checkOrigin(String)}. */ @Nullable protected List<String> checkHeaders(CorsConfiguration config, List<String> requestHeaders) { return config.checkHeaders(requestHeaders); }