Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Titouan Soulard
erp5
Commits
51f321d8
Commit
51f321d8
authored
Jan 29, 2021
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WSGITask: Patch should be enabled only if waitress egg is available
parent
19add837
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
15 deletions
+20
-15
product/ERP5Type/patches/WSGITask.py
product/ERP5Type/patches/WSGITask.py
+20
-15
No files found.
product/ERP5Type/patches/WSGITask.py
View file @
51f321d8
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
import
ZPublisher.HTTPRequest
import
ZPublisher.HTTPRequest
from
waitress.task
import
WSGITask
try
:
from
waitress.task
import
WSGITask
except
ImportError
:
WSGITask
=
None
WSGITask_get_environment
=
WSGITask
.
get_environment
# Patch should be enabled only if waitress egg is available
if
WSGITask
is
not
None
:
WSGITask_get_environment
=
WSGITask
.
get_environment
def
get_environment
(
self
):
def
get_environment
(
self
):
if
ZPublisher
.
HTTPRequest
.
trusted_proxies
==
(
'0.0.0.0'
,):
# Magic value to enable this functionality
if
ZPublisher
.
HTTPRequest
.
trusted_proxies
==
(
'0.0.0.0'
,):
# Magic value to enable this functionality
# Frontend-facing proxy is responsible for sanitising
# Frontend-facing proxy is responsible for sanitising
# X_FORWARDED_FOR, and only trusted accesses should bypass
# X_FORWARDED_FOR, and only trusted accesses should bypass
...
@@ -21,4 +26,4 @@ def get_environment(self):
...
@@ -21,4 +26,4 @@ def get_environment(self):
return
environ
return
environ
WSGITask
.
get_environment
=
get_environment
WSGITask
.
get_environment
=
get_environment
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment