]> git.0d.be Git - wcs-on-openshift.git/commitdiff
remove tld support to get full domains in cookies
authorFrédéric Péters <fpeters@0d.be>
Wed, 12 Aug 2015 09:59:34 +0000 (11:59 +0200)
committerFrédéric Péters <fpeters@0d.be>
Wed, 12 Aug 2015 09:59:34 +0000 (11:59 +0200)
wsgi.py

diff --git a/wsgi.py b/wsgi.py
index 785614bf055554dff3488c683100525bffd94526..52e52295b5d28c2726a053653cce1f2ffe10f7c0 100644 (file)
--- a/wsgi.py
+++ b/wsgi.py
@@ -14,7 +14,11 @@ if 'OPENSHIFT_PYTHON_DIR' in os.environ:
 # line, it's possible required libraries won't be in your searchable path
 #
 
-sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'wcs'))
+BASE_WCS_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'wcs')
+sys.path.append(BASE_WCS_DIR)
+if os.path.exists(os.path.join(BASE_WCS_DIR, 'data/vendor/effective_tld_names.dat')):
+    # remove that file to get full domaine name in cookies
+    os.unlink(os.path.join(BASE_WCS_DIR, 'data/vendor/effective_tld_names.dat'))
 
 from wcs import publisher
 from wcs.qommon.http_request import HTTPRequest
@@ -42,8 +46,7 @@ class QWIP:
         return result
 
 publisher.WcsPublisher.APP_DIR = os.environ.get('OPENSHIFT_DATA_DIR', '/tmp/')
-publisher.WcsPublisher.DATA_DIR = os.path.join(
-        os.path.dirname(os.path.abspath(__file__)), 'wcs', 'data')
+publisher.WcsPublisher.DATA_DIR = os.path.join(BASE_WCS_DIR, 'data')
 pub = publisher.WcsPublisher.create_publisher(register_cron=False)
 
 application = QWIP(pub)