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
3af0f6a5
Commit
3af0f6a5
authored
May 28, 1999
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*** empty log message ***
parent
c3959878
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
15 deletions
+4
-15
lib/python/App/ImageFile.py
lib/python/App/ImageFile.py
+4
-15
No files found.
lib/python/App/ImageFile.py
View file @
3af0f6a5
...
...
@@ -84,7 +84,7 @@
##############################################################################
"""Image object that is stored in a file"""
__version__
=
'$Revision: 1.
8
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.
9
$'
[
11
:
-
2
]
from
OFS.content_types
import
guess_content_type
from
Globals
import
package_home
...
...
@@ -119,22 +119,10 @@ class ImageFile(Acquisition.Explicit):
self
.
lmt
=
float
(
stat
(
path
)[
8
])
or
time
()
self
.
lmh
=
rfc1123_date
(
self
.
lmt
)
def
_init_headers
(
self
,
request
,
response
):
# Attempt to handle If-Modified-Since headers.
ms
=
request
.
get_header
(
'If-Modified-Since'
,
None
)
if
ms
is
not
None
:
ms
=
split
(
ms
,
';'
)[
0
]
ms
=
DateTime
(
ms
).
timeTime
()
if
self
.
lmt
>
ms
:
response
.
setStatus
(
304
)
return
response
response
.
setHeader
(
'Content-Type'
,
self
.
content_type
)
response
.
setHeader
(
'Last-Modified'
,
self
.
lmh
)
def
index_html
(
self
,
REQUEST
,
RESPONSE
):
"""Default document"""
if
self
.
_init_headers
(
REQUEST
,
RESPONSE
):
return
''
RESPONSE
.
setHeader
(
'Content-Type'
,
self
.
content_type
)
f
=
open
(
self
.
path
,
'rb'
)
data
=
f
.
read
()
f
.
close
()
...
...
@@ -143,7 +131,8 @@ class ImageFile(Acquisition.Explicit):
HEAD__roles__
=
None
def
HEAD
(
self
,
REQUEST
,
RESPONSE
):
""" """
self
.
_init_headers
(
self
,
REQUEST
,
RESPONSE
)
RESPONSE
.
setHeader
(
'Content-Type'
,
self
.
content_type
)
RESPONSE
.
setHeader
(
'Last-Modified'
,
self
.
lmh
)
return
''
def
__len__
(
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