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
d3ef404a
Commit
d3ef404a
authored
Jan 08, 1999
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes to Request.get_header
parent
81ecb603
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
4 deletions
+15
-4
lib/python/ZPublisher/Request.py
lib/python/ZPublisher/Request.py
+15
-4
No files found.
lib/python/ZPublisher/Request.py
View file @
d3ef404a
...
...
@@ -82,7 +82,7 @@
# file.
#
##############################################################################
__version__
=
'$Revision: 1.
3
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.
4
$'
[
11
:
-
2
]
import
regex
from
string
import
atoi
,
atol
,
join
,
upper
,
split
,
strip
,
rfind
...
...
@@ -280,7 +280,18 @@ class Request:
return
self
.
get
(
key
,
Request
)
is
not
Request
def
get_header
(
self
,
name
,
default
=
None
):
# Return the named HTTP header, or an optional default
# argument or None if the header is not found.
"""Return the named HTTP header, or an optional default
argument or None if the header is not found. Note that
both original and CGI-ified header names are recognized,
e.g. 'Content-Type', 'CONTENT_TYPE' and 'HTTP_CONTENT_TYPE'
should all return the Content-Type header, if available.
"""
environ
=
self
.
environ
name
=
upper
(
join
(
split
(
name
,
"-"
),
"_"
))
return
self
.
environ
.
get
(
name
,
default
)
val
=
environ
.
get
(
name
,
None
)
if
val
is
not
None
:
return
val
if
name
[:
5
]
!=
'HTTP_'
:
name
=
'HTTP_%s'
%
name
return
environ
.
get
(
name
,
default
)
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