Activity log for bug #1065127

Date Who What changed Old value New value Message
2012-10-10 16:29:09 The Loeki bug added bug
2012-10-10 16:30:07 The Loeki openobject-server: status New Confirmed
2012-10-10 16:30:20 The Loeki description When OpenERP (at least 6.1+) is deployed behind a proxy, the dbfilter option won't work. This is due to openerp/addons/web/controllers/main.py (lines 136+) doing: def db_list(req): dbs = [] proxy = req.session.proxy("db") dbs = proxy.list() 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)] return dbs However, in proxy configs, it should user HTTP_X_FORWARDED_HOST as filter. This can easily be done by checking whether that var is in the environ: def db_list(req): dbs = [] proxy = req.session.proxy("db") dbs = proxy.list() if 'HTTP_X_FORWARDED_HOST' in req.httprequest.environ: h = 'HTTP_X_FORWARDED_HOST' else: h = 'HTTP_HOST' h = req.httprequest.environ[h].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)] return dbs When OpenERP (at least 6.1+) is deployed behind a proxy, the dbfilter option won't work. This is due to openerp/addons/web/controllers/main.py (lines 136+) doing: def db_list(req):     dbs = []     proxy = req.session.proxy("db")     dbs = proxy.list()     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)]     return dbs However, in proxy configs, it should user HTTP_X_FORWARDED_HOST as filter. This can easily be done by checking whether that var is in the environ: def db_list(req):     dbs = []     proxy = req.session.proxy("db")     dbs = proxy.list()     if 'HTTP_X_FORWARDED_HOST' in req.httprequest.environ:         h = 'HTTP_X_FORWARDED_HOST'     else:         h = 'HTTP_HOST'     h = req.httprequest.environ[h].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)]     return dbs
2012-10-10 16:31:23 The Loeki description When OpenERP (at least 6.1+) is deployed behind a proxy, the dbfilter option won't work. This is due to openerp/addons/web/controllers/main.py (lines 136+) doing: def db_list(req):     dbs = []     proxy = req.session.proxy("db")     dbs = proxy.list()     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)]     return dbs However, in proxy configs, it should user HTTP_X_FORWARDED_HOST as filter. This can easily be done by checking whether that var is in the environ: def db_list(req):     dbs = []     proxy = req.session.proxy("db")     dbs = proxy.list()     if 'HTTP_X_FORWARDED_HOST' in req.httprequest.environ:         h = 'HTTP_X_FORWARDED_HOST'     else:         h = 'HTTP_HOST'     h = req.httprequest.environ[h].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)]     return dbs First reported in #940439 by Alvar V. (alvar-vilu), but it's actually a different bug than the one discussed there: When OpenERP (at least 6.1+) is deployed behind a proxy, the dbfilter option won't work. This is due to openerp/addons/web/controllers/main.py (lines 136+) doing: def db_list(req):     dbs = []     proxy = req.session.proxy("db")     dbs = proxy.list()     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)]     return dbs However, in proxy configs, it should user HTTP_X_FORWARDED_HOST as filter. This can easily be done by checking whether that var is in the environ: def db_list(req):     dbs = []     proxy = req.session.proxy("db")     dbs = proxy.list()     if 'HTTP_X_FORWARDED_HOST' in req.httprequest.environ:         h = 'HTTP_X_FORWARDED_HOST'     else:         h = 'HTTP_HOST'     h = req.httprequest.environ[h].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)]     return dbs
2012-10-10 16:31:33 The Loeki tags dbfilter dbfilter proxy
2012-10-10 16:32:13 The Loeki description First reported in #940439 by Alvar V. (alvar-vilu), but it's actually a different bug than the one discussed there: When OpenERP (at least 6.1+) is deployed behind a proxy, the dbfilter option won't work. This is due to openerp/addons/web/controllers/main.py (lines 136+) doing: def db_list(req):     dbs = []     proxy = req.session.proxy("db")     dbs = proxy.list()     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)]     return dbs However, in proxy configs, it should user HTTP_X_FORWARDED_HOST as filter. This can easily be done by checking whether that var is in the environ: def db_list(req):     dbs = []     proxy = req.session.proxy("db")     dbs = proxy.list()     if 'HTTP_X_FORWARDED_HOST' in req.httprequest.environ:         h = 'HTTP_X_FORWARDED_HOST'     else:         h = 'HTTP_HOST'     h = req.httprequest.environ[h].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)]     return dbs First reported in https://bugs.launchpad.net/openobject-server/+bug/940439/comments/6 by Alvar V. (alvar-vilu), but it's actually a different bug than the one discussed there: When OpenERP (at least 6.1+) is deployed behind a proxy, the dbfilter option won't work. This is due to openerp/addons/web/controllers/main.py (lines 136+) doing: def db_list(req):     dbs = []     proxy = req.session.proxy("db")     dbs = proxy.list()     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)]     return dbs However, in proxy configs, it should user HTTP_X_FORWARDED_HOST as filter. This can easily be done by checking whether that var is in the environ: def db_list(req):     dbs = []     proxy = req.session.proxy("db")     dbs = proxy.list()     if 'HTTP_X_FORWARDED_HOST' in req.httprequest.environ:         h = 'HTTP_X_FORWARDED_HOST'     else:         h = 'HTTP_HOST'     h = req.httprequest.environ[h].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)]     return dbs
2013-03-13 04:49:30 Jignesh Rathod(OpenERP) openobject-server: importance Undecided Medium
2013-03-13 04:49:30 Jignesh Rathod(OpenERP) openobject-server: assignee OpenERP's Framework R&D (openerp-dev-framework)
2013-06-27 14:24:56 OE Tester bug added subscriber OE Tester