aboutsummaryrefslogtreecommitdiff
path: root/src/java/com/juick/http
diff options
context:
space:
mode:
Diffstat (limited to 'src/java/com/juick/http')
-rw-r--r--src/java/com/juick/http/www/Main.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/java/com/juick/http/www/Main.java b/src/java/com/juick/http/www/Main.java
index 2417e6c8..66237ebe 100644
--- a/src/java/com/juick/http/www/Main.java
+++ b/src/java/com/juick/http/www/Main.java
@@ -23,6 +23,7 @@ import com.juick.xmpp.StreamComponent;
import java.io.FileInputStream;
import java.io.IOException;
import java.net.Socket;
+import java.net.URLEncoder;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
@@ -142,8 +143,13 @@ public class Main extends HttpServlet implements Stream.StreamListener {
String uri = request.getRequestURI();
if (uri.equals("/")) {
- com.juick.User visitor = Utils.getVisitorUser(sql, request, response);
- home.doGet(sql, sqlSearch, request, response, visitor);
+ String tag = request.getParameter("tag");
+ if (tag != null) {
+ Utils.sendPermanentRedirect(response, "/tag/" + URLEncoder.encode(tag, "UTF-8"));
+ } else {
+ com.juick.User visitor = Utils.getVisitorUser(sql, request, response);
+ home.doGet(sql, sqlSearch, request, response, visitor);
+ }
} else if (uri.equals("/post")) {
com.juick.User visitor = Utils.getVisitorUser(sql, request, response);
if (visitor != null) {