Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
83b2bf6d
Commit
83b2bf6d
authored
Mar 09, 2007
by
Collin Winter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Patch #1481079: Support of HTTP_REFERER in CGIHTTPServer.py
parent
a30fcb4d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
Lib/CGIHTTPServer.py
Lib/CGIHTTPServer.py
+4
-1
No files found.
Lib/CGIHTTPServer.py
View file @
83b2bf6d
...
...
@@ -197,6 +197,9 @@ class CGIHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
length
=
self
.
headers
.
getheader
(
'content-length'
)
if
length
:
env
[
'CONTENT_LENGTH'
]
=
length
referer
=
self
.
headers
.
getheader
(
'referer'
)
if
referer
:
env
[
'HTTP_REFERER'
]
=
referer
accept
=
[]
for
line
in
self
.
headers
.
getallmatchingheaders
(
'accept'
):
if
line
[:
1
]
in
"
\
t
\
n
\
r
"
:
...
...
@@ -214,7 +217,7 @@ class CGIHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
# Since we're setting the env in the parent, provide empty
# values to override previously set values
for
k
in
(
'QUERY_STRING'
,
'REMOTE_HOST'
,
'CONTENT_LENGTH'
,
'HTTP_USER_AGENT'
,
'HTTP_COOKIE'
):
'HTTP_USER_AGENT'
,
'HTTP_COOKIE'
,
'HTTP_REFERER'
):
env
.
setdefault
(
k
,
""
)
os
.
environ
.
update
(
env
)
...
...
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