sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hshreedha...@apache.org
Subject git commit: SQOOP-1089. Sqoop2: Accept Language header default.
Date Tue, 02 Jul 2013 03:53:46 GMT
Updated Branches:
  refs/heads/sqoop2 214cde024 -> 226044d3b


SQOOP-1089. Sqoop2: Accept Language header default.

(Abraham Elmahrek via Hari Shreedharan)


Project: http://git-wip-us.apache.org/repos/asf/sqoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/sqoop/commit/226044d3
Tree: http://git-wip-us.apache.org/repos/asf/sqoop/tree/226044d3
Diff: http://git-wip-us.apache.org/repos/asf/sqoop/diff/226044d3

Branch: refs/heads/sqoop2
Commit: 226044d3b37e3ae803fb9b92f1e45e15f4e072a7
Parents: 214cde0
Author: Hari Shreedharan <hshreedharan@apache.org>
Authored: Mon Jul 1 20:52:52 2013 -0700
Committer: Hari Shreedharan <hshreedharan@apache.org>
Committed: Mon Jul 1 20:52:52 2013 -0700

----------------------------------------------------------------------
 .../src/main/java/org/apache/sqoop/server/RequestContext.java  | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/226044d3/server/src/main/java/org/apache/sqoop/server/RequestContext.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/sqoop/server/RequestContext.java b/server/src/main/java/org/apache/sqoop/server/RequestContext.java
index 4ed7f58..b1a74fc 100644
--- a/server/src/main/java/org/apache/sqoop/server/RequestContext.java
+++ b/server/src/main/java/org/apache/sqoop/server/RequestContext.java
@@ -98,7 +98,11 @@ public class RequestContext {
    * @return First specified locale
    */
   public Locale getAcceptLanguageHeader() {
-    return new Locale(request.getHeader("Accept-Language"));
+    String lang = request.getHeader("Accept-Language");
+    if (lang == null) {
+      lang = Locale.getDefault().getLanguage();
+    }
+    return new Locale(lang);
   }
 
   /**


Mime
View raw message