diff -r 1c9208fa9127 roundup/cgi/client.py --- a/roundup/cgi/client.py Sat Feb 16 16:12:37 2019 -0500 +++ b/roundup/cgi/client.py Sun Feb 17 16:52:08 2019 +0100 @@ -1110,9 +1110,9 @@ header_pass += 1 enforce=config['WEB_CSRF_ENFORCE_HEADER_X-FORWARDED-HOST'] - if 'HTTP_X-FORWARDED-HOST' in self.env: + if 'HTTP_X_FORWARDED_HOST' in self.env: if enforce != "no": - host = self.env['HTTP_X-FORWARDED-HOST'] + host = self.env['HTTP_X_FORWARDED_HOST'] foundat = self.base.find('://' + host + '/') # 4 means self.base has http:/ prefix, 5 means https:/ prefix if foundat not in [4, 5]: @@ -1159,7 +1159,7 @@ # Note we do not use CSRF nonces for xmlrpc requests. # # see: https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)_Prevention_Cheat_Sheet#Protecting_REST_Services:_Use_of_Custom_Request_Headers - if 'HTTP_X-REQUESTED-WITH' not in self.env: + if 'HTTP_X_REQUESTED_WITH' not in self.env: logger.error(self._("csrf X-REQUESTED-WITH xmlrpc required header check failed for user%s."), current_user) raise UsageError(self._("Required Header Missing")) diff -r 1c9208fa9127 roundup/scripts/roundup_server.py --- a/roundup/scripts/roundup_server.py Sat Feb 16 16:12:37 2019 -0500 +++ b/roundup/scripts/roundup_server.py Sun Feb 17 16:52:08 2019 +0100 @@ -411,7 +411,7 @@ # If behind a proxy, this is the hostname supplied # via the Host header to the proxy. Used by core code. # Controlled by the CSRF settings. - env['HTTP_X-FORWARDED-HOST'] = xfh + env['HTTP_X_FORWARDED_HOST'] = xfh xff = self.headers.get('X-Forwarded-For', None) if xff: # xff is a list of ip addresses for original client/proxies: @@ -421,7 +421,7 @@ # Made available for extensions if the user trusts it. # E.g. you may wish to disable recaptcha validation extension # if the ip of the client matches 172.16.0.0. - env['HTTP_X-FORWARDED-FOR'] = xff + env['HTTP_X_FORWARDED_FOR'] = xff xfp = self.headers.get('X-Forwarded-Proto', None) if xfp: # xfp is the protocol (http/https) seen by proxies in the @@ -435,7 +435,7 @@ # May not be trustworthy. Do not use in core without # config option to control its use. # Made available for extensions if the user trusts it. - env['HTTP_X-FORWARDED-PROTO'] = xfp + env['HTTP_X_FORWARDED_PROTO'] = xfp if 'CGI_SHOW_TIMING' in os.environ: env['CGI_SHOW_TIMING'] = os.environ['CGI_SHOW_TIMING'] env['HTTP_ACCEPT_LANGUAGE'] = self.headers.get('accept-language') @@ -447,7 +447,7 @@ env['HTTP_ORIGIN'] = origin xrw = self.headers.get('x-requested-with') if xrw: - env['HTTP_X-REQUESTED-WITH'] = xrw + env['HTTP_X_REQUESTED_WITH'] = xrw range = self.headers.get('range') if range: env['HTTP_RANGE'] = range diff -r 1c9208fa9127 test/test_cgi.py --- a/test/test_cgi.py Sat Feb 16 16:12:37 2019 -0500 +++ b/test/test_cgi.py Sun Feb 17 16:52:08 2019 +0100 @@ -904,7 +904,7 @@ del(cl.env['HTTP_ORIGIN']) del(out[0]) - cl.env['HTTP_X-FORWARDED-HOST'] = 'whoami.com' + cl.env['HTTP_X_FORWARDED_HOST'] = 'whoami.com' # if there is an X-FORWARDED-HOST header it is used and # HOST header is ignored. X-FORWARDED-HOST should only be # passed/set by a proxy. In this case the HOST header is @@ -915,7 +915,7 @@ match_at=out[0].find('Redirecting to