aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/www/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/juick/www/controllers')
-rw-r--r--src/main/java/com/juick/www/controllers/Site.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/main/java/com/juick/www/controllers/Site.java b/src/main/java/com/juick/www/controllers/Site.java
index cbc14496..1dc4c338 100644
--- a/src/main/java/com/juick/www/controllers/Site.java
+++ b/src/main/java/com/juick/www/controllers/Site.java
@@ -43,6 +43,7 @@ import org.springframework.security.web.WebAttributes;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;
+import org.springframework.web.servlet.view.RedirectView;
import javax.inject.Inject;
import java.net.URLEncoder;
@@ -477,14 +478,14 @@ public class Site {
return "views/pm_sent";
}
- @GetMapping(value = "/{uname}/{mid}", produces = { Context.LD_JSON_MEDIA_TYPE, Context.ACTIVITY_MEDIA_TYPE,
- Context.ACTIVITYSTREAMS_PROFILE_MEDIA_TYPE, MediaType.APPLICATION_JSON_VALUE })
- public String threadRedirect(@PathVariable int mid) {
+ @GetMapping(value = "/{uname}/{mid}", produces = { MediaType.APPLICATION_JSON_VALUE, Context.LD_JSON_MEDIA_TYPE, Context.ACTIVITY_MEDIA_TYPE,
+ Context.ACTIVITYSTREAMS_PROFILE_MEDIA_TYPE })
+ public RedirectView threadRedirect(@PathVariable String uname, @PathVariable int mid) {
String linkedDataLocation = "/n/" + mid + "-0";
- return "redirect:" + linkedDataLocation;
+ return new RedirectView(linkedDataLocation);
}
- @GetMapping(value = "/{uname}/{mid}", consumes = MediaType.ALL_VALUE, produces = MediaType.TEXT_HTML_VALUE)
+ @GetMapping(value = "/{uname}/{mid}", produces = { MediaType.TEXT_HTML_VALUE, MediaType.ALL_VALUE })
protected String threadAction(@ModelAttribute User visitor, ModelMap model, @PathVariable String uname,
@PathVariable int mid,
@CookieValue(name = "sape_cookie", required = false, defaultValue = StringUtils.EMPTY) String sapeCookie) {