[FIX] database get_list use wsgi hostname
authorAntony Lesuisse <al@openerp.com>
Tue, 21 Feb 2012 18:57:39 +0000 (19:57 +0100)
committerAntony Lesuisse <al@openerp.com>
Tue, 21 Feb 2012 18:57:39 +0000 (19:57 +0100)
bzr revid: al@openerp.com-20120221185739-7utcld4kcnf39fg5

addons/web/controllers/main.py

index eaf3d67..cfb87a0 100644 (file)
@@ -351,7 +351,7 @@ class Database(openerpweb.Controller):
     def get_list(self, req):
         proxy = req.session.proxy("db")
         dbs = proxy.list()
-        h = req.httprequest.headers['Host'].split(':')[0]
+        h = req.httprequest.environ['HTTP_HOST'].split(':')[0]
         d = h.split('.')[0]
         r = req.config.dbfilter.replace('%h', h).replace('%d', d)
         dbs = [i for i in dbs if re.match(r, i)]