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
e6dd0bb5
Commit
e6dd0bb5
authored
May 12, 2000
by
Shane Hathaway
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Collector bug 1235.
parent
def6cfbb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
lib/python/ZPublisher/HTTPResponse.py
lib/python/ZPublisher/HTTPResponse.py
+9
-2
No files found.
lib/python/ZPublisher/HTTPResponse.py
View file @
e6dd0bb5
...
...
@@ -84,8 +84,8 @@
##############################################################################
'''CGI Response Output formatter
$Id: HTTPResponse.py,v 1.2
6 2000/03/31 17:11:33 jim
Exp $'''
__version__
=
'$Revision: 1.2
6
$'
[
11
:
-
2
]
$Id: HTTPResponse.py,v 1.2
7 2000/05/12 20:12:29 shane
Exp $'''
__version__
=
'$Revision: 1.2
7
$'
[
11
:
-
2
]
import
string
,
types
,
sys
,
regex
from
string
import
find
,
rfind
,
lower
,
upper
,
strip
,
split
,
join
,
translate
...
...
@@ -188,6 +188,7 @@ class HTTPResponse(BaseResponse):
body
=
''
realm
=
'Zope'
_error_format
=
'text/html'
_locked_status
=
0
def
__init__
(
self
,
body
=
''
,
status
=
200
,
headers
=
None
,
stdout
=
sys
.
stdout
,
stderr
=
sys
.
stderr
,):
...
...
@@ -229,6 +230,11 @@ class HTTPResponse(BaseResponse):
NotFound, InternalError, NotImplemented, BadGateway,
ServiceUnavailable } that will be converted to the correct
integer value. '''
if
self
.
_locked_status
:
# Don't change the response status.
# It has already been determined.
return
if
type
(
status
)
is
types
.
StringType
:
status
=
lower
(
status
)
if
status_codes
.
has_key
(
status
):
status
=
status_codes
[
status
]
...
...
@@ -448,6 +454,7 @@ class HTTPResponse(BaseResponse):
def redirect(self, location):
"""Cause a redirection without raising an error"""
self.status=302
self._locked_status = 1 # Don't let anything change the status code.
headers=self.headers
headers['status']='302 Moved Temporarily'
headers['location']=location
...
...
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