Skip to content

Commit 75b9a63

Browse files
author
eugenp
committed
initial (unfinished) work for allowing OPTIONS request for Discoverability purposes
1 parent 6d1bdd9 commit 75b9a63

2 files changed

Lines changed: 12 additions & 5 deletions

File tree

‎sec/src/main/java/org/rest/sec/web/controller/PrivilegeController.java‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ public PrivilegeController() {
4141

4242
// API
4343

44+
/*@RequestMapping(value = "/*", method = RequestMethod.OPTIONS)
45+
@ResponseBody
46+
public void options() {
47+
System.out.println();
48+
}*/
49+
4450
// search
4551

4652
@RequestMapping(params = { QueryConstants.Q_PARAM }, method = RequestMethod.GET)

‎sec/src/main/webapp/WEB-INF/web.xml‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
3-
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
4-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5-
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
6-
id="rest-sec" version="3.0">
2+
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="rest-sec" version="3.0">
74

85
<display-name>rest</display-name>
96

@@ -63,6 +60,10 @@
6360
<param-name>contextConfigLocation</param-name>
6461
<param-value>org.spring.sec2.spring</param-value> <!-- won't find anything -->
6562
</init-param>
63+
<init-param>
64+
<param-name>dispatchOptionsRequest</param-name>
65+
<param-value>true</param-value>
66+
</init-param>
6667

6768
<load-on-startup>1</load-on-startup>
6869
</servlet>

0 commit comments

Comments
 (0)