aboutsummaryrefslogtreecommitdiff
path: root/src/java/com/juick/http/www/Utils.java
diff options
context:
space:
mode:
authorGravatar Ugnich Anton2014-02-23 12:11:58 +0700
committerGravatar Ugnich Anton2014-02-23 12:11:58 +0700
commite67f01bb08125eae47c42965367dc96624e5f146 (patch)
tree416e60dc467ce78ec8584eda222c99204c4958a1 /src/java/com/juick/http/www/Utils.java
parent4c5feeaf06e2f160bd75bf1919cb9920835efc87 (diff)
isMobileRequest
Diffstat (limited to 'src/java/com/juick/http/www/Utils.java')
-rw-r--r--src/java/com/juick/http/www/Utils.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/java/com/juick/http/www/Utils.java b/src/java/com/juick/http/www/Utils.java
index 35b918b8..66450acd 100644
--- a/src/java/com/juick/http/www/Utils.java
+++ b/src/java/com/juick/http/www/Utils.java
@@ -61,6 +61,11 @@ public class Utils {
}
}
+ public static boolean isMobileRequest(HttpServletRequest request) {
+ String ua = request.getHeader("User-Agent");
+ return ua != null && ua.contains(" Juick/");
+ }
+
public static void sendTemporaryRedirect(HttpServletResponse response, String location) {
response.setStatus(HttpServletResponse.SC_MOVED_TEMPORARILY);
response.setHeader("Location", location);