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
d8db8a45
Commit
d8db8a45
authored
Jul 06, 2000
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge If-Modified-Since fix from 2.2 branch
parent
49c7f95f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
10 deletions
+18
-10
lib/python/OFS/Image.py
lib/python/OFS/Image.py
+18
-10
No files found.
lib/python/OFS/Image.py
View file @
d8db8a45
...
...
@@ -84,7 +84,7 @@
##############################################################################
"""Image object"""
__version__
=
'$Revision: 1.1
09
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.1
10
$'
[
11
:
-
2
]
import
Globals
,
string
,
struct
,
content_types
from
OFS.content_types
import
guess_content_type
...
...
@@ -198,15 +198,23 @@ class File(Persistent,Implicit,PropertyManager,
header
=
REQUEST
.
get_header
(
'If-Modified-Since'
,
None
)
if
header
is
not
None
:
header
=
string
.
split
(
header
,
';'
)[
0
]
mod_since
=
long
(
DateTime
(
header
).
timeTime
())
if
self
.
_p_mtime
:
last_mod
=
long
(
self
.
_p_mtime
)
else
:
last_mod
=
long
(
0
)
if
last_mod
>
0
and
last_mod
<=
mod_since
:
RESPONSE
.
setStatus
(
304
)
return
RESPONSE
# Some proxies seem to send invalid date strings for this
# header. If the date string is not valid, we ignore it
# rather than raise an error to be generally consistent
# with common servers such as Apache (which can usually
# understand the screwy date string as a lucky side effect
# of the way they parse it).
try
:
mod_since
=
long
(
DateTime
(
header
).
timeTime
())
except
:
mod_since
=
None
if
mod_since
is
not
None
:
if
self
.
_p_mtime
:
last_mod
=
long
(
self
.
_p_mtime
)
else
:
last_mod
=
long
(
0
)
if
last_mod
>
0
and
last_mod
<=
mod_since
:
RESPONSE
.
setStatus
(
304
)
return
RESPONSE
if
self
.
precondition
and
hasattr
(
self
,
self
.
precondition
):
# Grab whatever precondition was defined and then
# execute it. The precondition will raise an exception
...
...
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