The URL might not be set because it comes from `referer`, in that case match the first rule with no `regex_url`. It crashes before this commit because `re.search()` is expecting a string and `headers.get()` is defaulting to `None`. opw-2205202 closes odoo/odoo#46593 X-original-commit: e2f8caf07b2f749935df9184ded738cc1c482423 Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>