Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
9b2b00d9
Commit
9b2b00d9
authored
Jul 21, 2003
by
Chris McDonough
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Control trusted proxies with ZConfig instead of an environment variable.
parent
c33ae104
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
11 deletions
+7
-11
lib/python/ZPublisher/HTTPRequest.py
lib/python/ZPublisher/HTTPRequest.py
+7
-11
No files found.
lib/python/ZPublisher/HTTPRequest.py
View file @
9b2b00d9
...
...
@@ -11,7 +11,7 @@
#
##############################################################################
__version__
=
'$Revision: 1.9
0
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.9
1
$'
[
11
:
-
2
]
import
re
,
sys
,
os
,
urllib
,
time
,
random
,
cgi
,
codecs
from
types
import
StringType
,
UnicodeType
...
...
@@ -1517,18 +1517,14 @@ EMPTY=16
CONVERTED
=
32
# The
ZOPE_TRUSTED_PROXIES environment variable contains a colon separated
#
list
of front-end proxies that are trusted to supply an accurate
# The
trusted_proxies configuration setting contains a sequence
# of front-end proxies that are trusted to supply an accurate
# X_FORWARDED_FOR header. If REMOTE_ADDR is one of the values in this list
# and it has set an X_FORWARDED_FOR header, ZPublisher copies REMOTE_ADDR
# into X_FORWARDED_BY, and the last element of the X_FORWARDED_FOR list
# into REMOTE_ADDR. X_FORWARDED_FOR is left unchanged.
# This function parses the environment variable into a module variable
#
def
trusted_proxies
():
proxies
=
os
.
environ
.
get
(
'ZOPE_TRUSTED_PROXIES'
,
''
)
proxies
=
proxies
.
split
(
':'
)
proxies
=
[
p
.
strip
()
for
p
in
proxies
]
return
tuple
(
proxies
)
trusted_proxies
=
trusted_proxies
()
# The ZConfig machinery may sets this attribute on initialization
# if any trusted-proxies are defined in the configuration file.
trusted_proxies
=
[]
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