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
6ebf2d09
Commit
6ebf2d09
authored
May 28, 1999
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed Content-Type divination in DTMLMethods & docs.
parent
1b596117
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
16 deletions
+13
-16
lib/python/OFS/DTMLDocument.py
lib/python/OFS/DTMLDocument.py
+8
-10
lib/python/OFS/DTMLMethod.py
lib/python/OFS/DTMLMethod.py
+5
-6
No files found.
lib/python/OFS/DTMLDocument.py
View file @
6ebf2d09
...
...
@@ -84,7 +84,7 @@
##############################################################################
"""DTML Document objects."""
__version__
=
'$Revision: 1.2
4
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.2
5
$'
[
11
:
-
2
]
from
DocumentTemplate.DT_Util
import
InstanceDict
,
TemplateDict
from
ZPublisher.Converters
import
type_converters
from
Globals
import
HTML
,
HTMLFile
,
MessageDialog
...
...
@@ -181,17 +181,15 @@ class DTMLDocument(DTMLMethod, PropertyManager):
return
self
.
raise_standardErrorMessage
(
client
,
REQUEST
)
if
RESPONSE
is
None
:
return
r
# Try to handle content types intelligently...
if
self
.
__dict__
.
has_key
(
'content_type'
):
c
=
self
.
content_type
else
:
c
,
e
=
guess_content_type
(
self
.
__name__
,
r
)
RESPONSE
.
setHeader
(
'Content-Type'
,
c
)
hh
=
RESPONSE
.
headers
.
has_key
if
not
(
hh
(
'content-type'
)
or
hh
(
'Content-Type'
)
):
if
self
.
__dict__
.
has_key
(
'content_type'
):
c
=
self
.
content_type
else
:
c
,
e
=
guess_content_type
(
self
.
__name__
,
r
)
RESPONSE
.
setHeader
(
'Content-Type'
,
c
)
return
r
# We don't allow document to set headers
return
decapitate
(
r
,
RESPONSE
)
...
...
lib/python/OFS/DTMLMethod.py
View file @
6ebf2d09
...
...
@@ -84,7 +84,7 @@
##############################################################################
"""DTML Method objects."""
__version__
=
'$Revision: 1.2
3
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.2
4
$'
[
11
:
-
2
]
from
Globals
import
HTML
,
HTMLFile
,
MessageDialog
from
string
import
join
,
split
,
strip
,
rfind
,
atoi
,
lower
...
...
@@ -160,13 +160,12 @@ class DTMLMethod(cDocument, HTML, Acquisition.Implicit, RoleManager,
if
RESPONSE
is
None
:
return
r
# This was bad for dynamic content!
# RESPONSE.setHeader('Last-Modified', rfc1123_date(self._p_mtime))
# Ick. I don't like this. But someone can override it with
# a header if they have to.
c
,
e
=
guess_content_type
(
self
.
__name__
,
r
)
RESPONSE
.
setHeader
(
'Content-Type'
,
c
)
hh
=
RESPONSE
.
headers
.
has_key
if
not
(
hh
(
'content-type'
)
or
hh
(
'Content-Type'
)):
c
,
e
=
guess_content_type
(
self
.
__name__
,
r
)
RESPONSE
.
setHeader
(
'Content-Type'
,
c
)
return
decapitate
(
r
,
RESPONSE
)
def
get_size
(
self
):
...
...
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