aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/http/www/Login.java
diff options
context:
space:
mode:
authorGravatar Alex Bitney2016-02-06 16:33:29 +0200
committerGravatar Alex Bitney2016-02-06 16:33:29 +0200
commit032f5f7c62ed6932386e700a74dd7e519ad4de5d (patch)
treedd960cb1265c5b63a1eaccd091cb984b28a177d5 /src/main/java/com/juick/http/www/Login.java
parentbb93adcf1414001ec3e8439e9440547d52cc8e1d (diff)
domain independence in few places
fixed zero tags exception on user's page
Diffstat (limited to 'src/main/java/com/juick/http/www/Login.java')
-rw-r--r--src/main/java/com/juick/http/www/Login.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main/java/com/juick/http/www/Login.java b/src/main/java/com/juick/http/www/Login.java
index 00775fc1..f1f670b1 100644
--- a/src/main/java/com/juick/http/www/Login.java
+++ b/src/main/java/com/juick/http/www/Login.java
@@ -17,6 +17,7 @@
*/
package com.juick.http.www;
+import com.juick.server.Endpoints;
import org.springframework.jdbc.core.JdbcTemplate;
import javax.servlet.ServletException;
@@ -219,7 +220,7 @@ public class Login {
response.addCookie(c);
String referer = request.getHeader("Referer");
- if (referer != null && referer.startsWith("http://juick.com/") && !referer.equals("http://juick.com/login")) {
+ if (referer != null && referer.startsWith("http://"+Endpoints.wwwJuickCom+"/") && !referer.equals("http://"+Endpoints.wwwJuickCom+"/login")) {
response.sendRedirect(referer);
} else {
response.sendRedirect("/");
@@ -235,7 +236,7 @@ public class Login {
sql.update("DELETE FROM logins WHERE user_id=?", visitor.getUID());
Cookie c = new Cookie("hash", "-");
- c.setDomain(".juick.com");
+ c.setDomain("." + Endpoints.getWwwJuickComDomain());
c.setMaxAge(0);
response.addCookie(c);