Skip to content

Commit 3e04718

Browse files
committed
No CORS sec
1 parent e40c6f7 commit 3e04718

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

server-spring/src/main/java/com/example/chatengine/serverspring/UserController.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import org.json.JSONObject;
1212
import org.springframework.http.HttpStatus;
1313
import org.springframework.http.ResponseEntity;
14+
import org.springframework.web.bind.annotation.CrossOrigin;
1415
import org.springframework.web.bind.annotation.RequestBody;
1516
import org.springframework.web.bind.annotation.RequestMapping;
1617
import org.springframework.web.bind.annotation.RequestMethod;
@@ -24,6 +25,7 @@ public class UserController {
2425
private static String CHAT_ENGINE_PROJECT_ID = "5d498a31-cd23-42b7-b367-4fcc9463bd2f";
2526
private static String CHAT_ENGINE_PRIVATE_KEY = "49a46286-91c3-4f9c-92bf-284ae51b7628";
2627

28+
@CrossOrigin
2729
@RequestMapping(path = "/login", method = RequestMethod.POST)
2830
public ResponseEntity getLogin(@RequestBody HashMap<String, String> request) {
2931
HttpURLConnection con = null;
@@ -62,6 +64,7 @@ public ResponseEntity getLogin(@RequestBody HashMap<String, String> request) {
6264
}
6365
}
6466

67+
@CrossOrigin
6568
@RequestMapping(path = "/signup", method = RequestMethod.POST)
6669
public ResponseEntity newSignup(@RequestBody HashMap<String, String> request) {
6770
HttpURLConnection con = null;

0 commit comments

Comments
 (0)