summaryrefslogtreecommitdiffstats
path: root/ipaserver/rpcserver.py
diff options
context:
space:
mode:
authorAdam Young <ayoung@redhat.com>2010-09-20 16:44:50 -0400
committerAdam Young <ayoung@redhat.com>2010-09-21 16:28:14 -0400
commit4f2f016dd56beaeadf441d73502e8c0f475b6968 (patch)
tree80ce2c0af979c2ed58fc21fa0b3140cf77654d4f /ipaserver/rpcserver.py
parent8b4a0adcee55e39cbfd234415afc6fee050466d6 (diff)
downloadfreeipa-4f2f016dd56beaeadf441d73502e8c0f475b6968.tar.gz
freeipa-4f2f016dd56beaeadf441d73502e8c0f475b6968.tar.xz
freeipa-4f2f016dd56beaeadf441d73502e8c0f475b6968.zip
language as a list
Now parsing the list of languages set in the http header, and selecting the first. Handles weighting as well.
Diffstat (limited to 'ipaserver/rpcserver.py')
-rw-r--r--ipaserver/rpcserver.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/ipaserver/rpcserver.py b/ipaserver/rpcserver.py
index f17fe7d22..557ba4e0c 100644
--- a/ipaserver/rpcserver.py
+++ b/ipaserver/rpcserver.py
@@ -35,6 +35,7 @@ from ipalib.compat import json
from wsgiref.util import shift_path_info
import base64
import os
+import string
_not_found_template = """<html>
<head>
<title>404 Not Found</title>
@@ -195,7 +196,8 @@ class WSGIExecutioner(Executioner):
lang= os.environ['LANG']
try:
if ('HTTP_ACCEPT_LANGUAGE' in environ):
- os.environ['LANG']=environ['HTTP_ACCEPT_LANGUAGE']
+ os.environ['LANG']=string.split(
+ environ['HTTP_ACCEPT_LANGUAGE'],",")[0].split(';')[0]
if (
environ.get('CONTENT_TYPE', '').startswith(self.content_type)
and environ['REQUEST_METHOD'] == 'POST'