From 1e5a48a0f9eca579ac96652fe75c5e7370ba6b12 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9rome=20Maes?= Date: Mon, 8 Dec 2014 17:45:16 +0100 Subject: [PATCH] [FIX] im_livechat : do not crash if not Referer url in the header of the request. --- addons/im_livechat/im_livechat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/im_livechat/im_livechat.py b/addons/im_livechat/im_livechat.py index f2ad703..24430e1 100644 --- a/addons/im_livechat/im_livechat.py +++ b/addons/im_livechat/im_livechat.py @@ -308,7 +308,7 @@ class LiveChatController(http.Controller): if country_ids: country_id = country_ids[0] # extract url - url = request.httprequest.headers['Referer'] or request.httprequest.base_url + url = request.httprequest.headers.get('Referer', False) or request.httprequest.base_url # find the match rule for the given country and url rule = registry.get('im_livechat.channel.rule').match_rule(cr, uid, channel_id, url, country_id, context=context) if rule: -- 1.7.10.4