web/http_headers.py
changeset 10603 65ad6980976e
parent 10594 6a55853f14c9
child 10612 84468b90e9c1
--- a/web/http_headers.py	Mon Sep 14 12:19:48 2015 +0200
+++ b/web/http_headers.py	Tue Sep 22 09:39:30 2015 +0200
@@ -6,7 +6,9 @@
 from calendar import timegm
 import base64
 import re
-import urlparse
+
+from six.moves.urllib.parse import urlparse
+
 
 def dashCapitalize(s):
     ''' Capitalize a string, making sure to treat - as a word seperator '''
@@ -398,7 +400,7 @@
     """Ensure origin is a valid URL-base stuff, or null"""
     if origin == 'null':
         return origin
-    p = urlparse.urlparse(origin)
+    p = urlparse(origin)
     if p.params or p.query or p.username or p.path not in ('', '/'):
         raise ValueError('Incorrect Accept-Control-Allow-Origin value %s' % origin)
     if p.scheme not in ('http', 'https'):