Mercurial > p > roundup > code
diff roundup/cgi/client.py @ 7113:5c6dd791d638
bug: handle exception when origin header is missing
Handle the KeyError raised if self.env['HTTP_ORIGIN'] is missing.
This is the bug that triggered the fix to run_cgi's top level exception
handler.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Sun, 11 Dec 2022 18:54:21 -0500 |
| parents | 64e1058051f3 |
| children | 72a54826ff4f |
line wrap: on
line diff
--- a/roundup/cgi/client.py Sun Dec 11 18:47:24 2022 -0500 +++ b/roundup/cgi/client.py Sun Dec 11 18:54:21 2022 -0500 @@ -1259,7 +1259,11 @@ "allowed to use the web interface")) def is_origin_header_ok(self, api=False): - origin = self.env['HTTP_ORIGIN'] + try: + origin = self.env['HTTP_ORIGIN'] + except KeyError: + return False + # note base https://host/... ends host with with a /, # so add it to origin. foundat = self.base.find(origin + '/')
