|
1 | 1 | /*
|
2 |
| - * Copyright 2012-2017 the original author or authors. |
| 2 | + * Copyright 2012-2018 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
@@ -180,9 +180,9 @@ public void testHiddenHttpMethodFilterOrderedFirst() throws Exception {
|
180 | 180 | .postForEntity("http://localhost:" + port + "/", form, Object.class);
|
181 | 181 | assertThat(result.getStatusCode()).isEqualTo(HttpStatus.FORBIDDEN);
|
182 | 182 |
|
183 |
| - // override method with GET |
| 183 | + // override method with DELETE |
184 | 184 | form = new LinkedMultiValueMap<String, String>();
|
185 |
| - form.add("_method", "GET"); |
| 185 | + form.add("_method", "DELETE"); |
186 | 186 |
|
187 | 187 | result = rest.postForEntity("http://localhost:" + port + "/", form, Object.class);
|
188 | 188 | assertThat(result.getStatusCode()).isEqualTo(HttpStatus.NOT_FOUND);
|
@@ -337,7 +337,8 @@ protected static class DenyPostRequestConfig extends WebSecurityConfigurerAdapte
|
337 | 337 |
|
338 | 338 | @Override
|
339 | 339 | protected void configure(HttpSecurity http) throws Exception {
|
340 |
| - http.authorizeRequests().antMatchers(HttpMethod.POST, "/**").denyAll(); |
| 340 | + http.authorizeRequests().mvcMatchers(HttpMethod.POST, "/**").denyAll().and() |
| 341 | + .csrf().disable(); |
341 | 342 | }
|
342 | 343 |
|
343 | 344 | }
|
|
0 commit comments