Skip to content
This repository was archived by the owner on Dec 12, 2018. It is now read-only.

Commit 70fd06d

Browse files
mrioanmraible
authored andcommitted
1183 - Added PUT as a default allowed method in CORS (#1184)
1 parent 9c42087 commit 70fd06d

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

extensions/servlet/src/main/resources/com/stormpath/sdk/servlet/config/web.stormpath.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,4 +355,4 @@ stormpath.web.cors.enabled = true
355355
#Comma separated list of allowed origins
356356
stormpath.web.cors.allowed.originUris =
357357
stormpath.web.cors.allowed.headers = Content-Type,Accept,X-Requested-With,remember-me
358-
stormpath.web.cors.allowed.methods = POST,GET,OPTIONS,DELETE
358+
stormpath.web.cors.allowed.methods = POST,GET,OPTIONS,DELETE,PUT

extensions/spring/boot/stormpath-webmvc-spring-boot-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1024,7 +1024,7 @@
10241024
"name": "stormpath.web.cors.allowed.methods",
10251025
"type": "java.lang.String",
10261026
"description": "Comma separated list of allowed methods for a CORS request.",
1027-
"defaultValue": "POST,GET,OPTIONS,DELETE"
1027+
"defaultValue": "POST,GET,OPTIONS,DELETE,PUT"
10281028
}
10291029
]
10301030
}

extensions/spring/stormpath-spring-security-webmvc/src/test/groovy/com/stormpath/spring/config/CorsFilterIT.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ class CorsFilterIT extends AbstractTestNGSpringContextTests {
106106
void testAccessControlRequestMethodRequestFailsForPUT() {
107107
mvc.perform(options(new URI("/me"))
108108
.header("Origin", "http://localhost:3000")
109-
.header("Access-Control-Request-Method", "PUT") //PUT is not allowed
109+
.header("Access-Control-Request-Method", "HEAD") //HEAD is not allowed
110110
.accept(MediaType.APPLICATION_JSON))
111111
.andExpect(status().is(HttpServletResponse.SC_FORBIDDEN)); //403
112112

extensions/spring/stormpath-spring-webmvc/src/main/java/com/stormpath/spring/config/AbstractStormpathWebMvcConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ public abstract class AbstractStormpathWebMvcConfiguration {
407407
@Value("#{ @environment['stormpath.web.cors.allowed.headers'] ?: 'Content-Type,Accept,X-Requested-With,remember-me' }")
408408
protected String corsAllowedHeaders;
409409

410-
@Value("#{ @environment['stormpath.web.cors.allowed.methods'] ?: 'POST,GET,OPTIONS,DELETE' }")
410+
@Value("#{ @environment['stormpath.web.cors.allowed.methods'] ?: 'POST,GET,OPTIONS,DELETE,PUT' }")
411411
protected String corsAllowedMethods;
412412

413413
@Autowired(required = false)

0 commit comments

Comments
 (0)