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
eca3b9e2
Commit
eca3b9e2
authored
Jan 28, 1997
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bug that caused html didling of non-html data
parent
81ce5b5b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
lib/python/ZPublisher/Response.py
lib/python/ZPublisher/Response.py
+10
-2
No files found.
lib/python/ZPublisher/Response.py
View file @
eca3b9e2
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
__doc__
=
'''CGI Response Output formatter
__doc__
=
'''CGI Response Output formatter
$Id: Response.py,v 1.1
1 1996/09/16 14:43:25
jim Exp $'''
$Id: Response.py,v 1.1
2 1997/01/28 22:59:19
jim Exp $'''
# Copyright
# Copyright
#
#
# Copyright 1996 Digital Creations, L.C., 910 Princess Anne
# Copyright 1996 Digital Creations, L.C., 910 Princess Anne
...
@@ -55,6 +55,9 @@ $Id: Response.py,v 1.11 1996/09/16 14:43:25 jim Exp $'''
...
@@ -55,6 +55,9 @@ $Id: Response.py,v 1.11 1996/09/16 14:43:25 jim Exp $'''
# (540) 371-6909
# (540) 371-6909
#
#
# $Log: Response.py,v $
# $Log: Response.py,v $
# Revision 1.12 1997/01/28 22:59:19 jim
# Fixed bug that caused html didling of non-html data
#
# Revision 1.11 1996/09/16 14:43:25 jim
# Revision 1.11 1996/09/16 14:43:25 jim
# Changes to make shutdown methods work properly. Now shutdown methods
# Changes to make shutdown methods work properly. Now shutdown methods
# can simply sys.exit(0).
# can simply sys.exit(0).
...
@@ -109,7 +112,7 @@ $Id: Response.py,v 1.11 1996/09/16 14:43:25 jim Exp $'''
...
@@ -109,7 +112,7 @@ $Id: Response.py,v 1.11 1996/09/16 14:43:25 jim Exp $'''
#
#
#
#
#
#
__version__
=
'$Revision: 1.1
1
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.1
2
$'
[
11
:
-
2
]
import
string
,
types
,
sys
,
regex
,
regsub
import
string
,
types
,
sys
,
regex
,
regsub
...
@@ -313,6 +316,9 @@ class Response:
...
@@ -313,6 +316,9 @@ class Response:
base_re
=
regex
.
compile
(
'
\
(<
b
ase[
\
0
- ]+
\
([^>]+
\
)>
\
)
'
,
base_re
=
regex
.
compile
(
'
\
(<
b
ase[
\
0
- ]+
\
([^>]+
\
)>
\
)
'
,
regex.casefold)
regex.casefold)
):
):
if (self.headers.has_key('
content
-
type
') and
self.headers['
content
-
type
']!='
text
/
html
'): return
if self.base:
if self.base:
body=self.body
body=self.body
if body:
if body:
...
@@ -542,6 +548,8 @@ class Response:
...
@@ -542,6 +548,8 @@ class Response:
else
:
else
:
c
=
'text/plain'
c
=
'text/plain'
self
.
setHeader
(
'content-type'
,
c
)
self
.
setHeader
(
'content-type'
,
c
)
else
:
isHTML
=
headers
[
'content-type'
]
==
'text/html'
if
isHTML
and
end_of_header_re
.
search
(
self
.
body
)
<
0
:
if
isHTML
and
end_of_header_re
.
search
(
self
.
body
)
<
0
:
htmlre
=
regex
.
compile
(
'<html>'
,
regex
.
casefold
)
htmlre
=
regex
.
compile
(
'<html>'
,
regex
.
casefold
)
lhtml
=
htmlre
.
search
(
body
)
lhtml
=
htmlre
.
search
(
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