Issue #144 (Add last_modified to WSF_SKELETON_HANDLER)

This commit is contained in:
Colin Adams
2014-11-18 10:37:36 +00:00
parent eaa3dd435a
commit 4f62da8f90
2 changed files with 14 additions and 0 deletions

View File

@@ -49,6 +49,10 @@ feature {NONE} -- Implementation
if attached a_handler.etag (req) as l_etag then
a_header.put_header_key_value ({HTTP_HEADER_NAMES}.header_etag, l_etag)
end
if attached a_handler.last_modified (req) as l_last_modified then
l_dt := (create {HTTP_DATE}.make_from_date_time (l_last_modified)).rfc1123_string
a_header.put_header_key_value ({HTTP_HEADER_NAMES}.header_last_modified, l_dt)
end
res.put_header_text (a_header.string)
if l_ok then
if l_chunked then

View File

@@ -166,6 +166,16 @@ feature -- Access
req_attached: req /= Void
deferred
end
last_modified (req: WSF_REQUEST): detachable DATE_TIME
-- When representation of resource selected in `req' was last modified;
-- SHOULD be set whenever it can reasonably be determined.
note
specification: "https://tools.ietf.org/html/rfc7232#section-2.2.1"
require
req_attached: req /= Void
deferred
end
modified_since (req: WSF_REQUEST; a_date_time: DATE_TIME): BOOLEAN
-- Has resource requested in `req' been modified since `a_date_time' (UTC)?