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
3074a9f5
Commit
3074a9f5
authored
Aug 30, 1996
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added code to map 300 redirects to 302.
parent
dfbe0d1b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
lib/python/ZPublisher/Response.py
lib/python/ZPublisher/Response.py
+13
-3
No files found.
lib/python/ZPublisher/Response.py
View file @
3074a9f5
...
...
@@ -3,7 +3,7 @@
__doc__
=
'''CGI Response Output formatter
$Id: Response.py,v 1.
8 1996/08/29 22:11:35
jfulton Exp $'''
$Id: Response.py,v 1.
9 1996/08/30 23:28:29
jfulton Exp $'''
# Copyright
#
# Copyright 1996 Digital Creations, L.C., 910 Princess Anne
...
...
@@ -55,6 +55,9 @@ $Id: Response.py,v 1.8 1996/08/29 22:11:35 jfulton Exp $'''
# (540) 371-6909
#
# $Log: Response.py,v $
# Revision 1.9 1996/08/30 23:28:29 jfulton
# Added code to map 300 redirects to 302.
#
# Revision 1.8 1996/08/29 22:11:35 jfulton
# Bug fixes.
#
...
...
@@ -97,7 +100,7 @@ $Id: Response.py,v 1.8 1996/08/29 22:11:35 jfulton Exp $'''
#
#
#
__version__
=
'$Revision: 1.
8
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.
9
$'
[
11
:
-
2
]
import
string
,
types
,
sys
,
regex
,
regsub
...
...
@@ -466,12 +469,14 @@ class Response:
self
.
setStatus
(
t
)
if
self
.
status
>=
300
and
self
.
status
<
400
:
if
type
(
v
)
==
types
.
StringType
and
absuri_re
.
match
(
v
)
>=
0
:
if
self
.
status
==
300
:
self
.
setStatus
(
302
)
self
.
setHeader
(
'location'
,
v
)
return
self
else
:
try
:
l
,
b
=
v
if
type
(
l
)
==
types
.
StringType
and
absuri_re
.
match
(
l
)
>=
0
:
if
self
.
status
==
300
:
self
.
setStatus
(
302
)
self
.
setHeader
(
'location'
,
l
)
self
.
setBody
(
b
)
return
self
...
...
@@ -539,7 +544,12 @@ class Response:
if
not
headers
.
has_key
(
'content-type'
)
and
self
.
status
==
200
:
self
.
setStatus
(
'nocontent'
)
headersl
=
map
(
lambda
k
,
d
=
headers
:
"%s: %s"
%
(
k
,
d
[
k
]),
headers
.
keys
())
def
upcase
(
s
):
return
string
.
upper
(
s
[:
1
])
+
s
[
1
:]
headersl
=
map
(
lambda
k
,
d
=
headers
,
upcase
=
upcase
:
"%s: %s"
%
(
upcase
(
k
),
d
[
k
]),
headers
.
keys
())
if
self
.
cookies
:
headersl
=
headersl
+
self
.
_cookie_list
()
headersl
[
len
(
headersl
):]
=
[
''
,
body
]
...
...
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