diff options
author | Vitaly Takmazov | 2016-11-25 10:04:29 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2016-11-25 10:04:29 +0300 |
commit | 68b230f42f93a2e801292a2085cc3fce3a676823 (patch) | |
tree | d2da2ed337641689829c1e483305046de01080b3 /juick-api/src/main/java/com/juick/api/controllers | |
parent | 6b018f65a4f0391bb7f8e2a06616b8541d0a452e (diff) |
juick-api: JSONP and CORS
Diffstat (limited to 'juick-api/src/main/java/com/juick/api/controllers')
-rw-r--r-- | juick-api/src/main/java/com/juick/api/controllers/Messages.java | 1 | ||||
-rw-r--r-- | juick-api/src/main/java/com/juick/api/controllers/util/JsonpAdvice.java | 14 |
2 files changed, 15 insertions, 0 deletions
diff --git a/juick-api/src/main/java/com/juick/api/controllers/Messages.java b/juick-api/src/main/java/com/juick/api/controllers/Messages.java index a6bd3f6d..f4cde321 100644 --- a/juick-api/src/main/java/com/juick/api/controllers/Messages.java +++ b/juick-api/src/main/java/com/juick/api/controllers/Messages.java @@ -16,6 +16,7 @@ import org.slf4j.LoggerFactory; import org.springframework.http.MediaType; import org.springframework.stereotype.Controller; import org.springframework.util.StringUtils; +import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; diff --git a/juick-api/src/main/java/com/juick/api/controllers/util/JsonpAdvice.java b/juick-api/src/main/java/com/juick/api/controllers/util/JsonpAdvice.java new file mode 100644 index 00000000..cc14976b --- /dev/null +++ b/juick-api/src/main/java/com/juick/api/controllers/util/JsonpAdvice.java @@ -0,0 +1,14 @@ +package com.juick.api.controllers.util; + +import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.servlet.mvc.method.annotation.AbstractJsonpResponseBodyAdvice; + +/** + * Created by vitalyster on 25.11.2016. + */ +@ControllerAdvice +public class JsonpAdvice extends AbstractJsonpResponseBodyAdvice { + public JsonpAdvice() { + super("callback"); + } +} |