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
ece9a512
Commit
ece9a512
authored
Nov 12, 1999
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed REQUEST.get() to behave like a dict.get().
parent
e9b87645
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
lib/python/ZPublisher/HTTPRequest.py
lib/python/ZPublisher/HTTPRequest.py
+6
-2
No files found.
lib/python/ZPublisher/HTTPRequest.py
View file @
ece9a512
...
...
@@ -83,7 +83,7 @@
#
##############################################################################
__version__
=
'$Revision: 1.2
5
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.2
6
$'
[
11
:
-
2
]
import
regex
,
sys
,
os
,
string
from
string
import
lower
,
atoi
,
rfind
,
split
,
strip
,
join
,
upper
,
find
...
...
@@ -684,6 +684,7 @@ class HTTPRequest(BaseRequest):
name
=
'HTTP_%s'
%
name
return
environ
.
get
(
name
,
default
)
def
__getitem__
(
self
,
key
,
default
=
_marker
,
# Any special internal marker will do
URLmatch
=
regex
.
compile
(
'URL[0-9]+$'
).
match
,
...
...
@@ -757,7 +758,10 @@ class HTTPRequest(BaseRequest):
raise
KeyError
,
key
__getattr__
=
get
=
__getitem__
__getattr__
=
__getitem__
def
get
(
self
,
key
,
default
=
None
):
return
self
.
__getitem__
(
key
,
default
)
def
has_key
(
self
,
key
):
try
:
self
[
key
]
...
...
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