Changed age to max_age
This commit is contained in:
@@ -14,7 +14,7 @@ feature -- Access
|
||||
-- 525600 = 365 * 24 * 60 * 60 = (almost) 1 year;
|
||||
-- See http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.21 for an explanation of why this means never expire
|
||||
|
||||
age (req: WSF_REQUEST): NATURAL
|
||||
max_age (req: WSF_REQUEST): NATURAL
|
||||
-- Maximum age in seconds before response to `req` is considered stale;
|
||||
-- This is used to generate a Cache-Control: max-age header.
|
||||
-- Return 0 to indicate already expired.
|
||||
@@ -35,7 +35,7 @@ feature -- Access
|
||||
require
|
||||
req_attached: req /= Void
|
||||
do
|
||||
Result := age (req)
|
||||
Result := max_age (req)
|
||||
ensure
|
||||
not_more_than_1_year: Result <= Never_expires
|
||||
end
|
||||
@@ -51,7 +51,7 @@ feature -- Access
|
||||
require
|
||||
req_attached: req /= Void
|
||||
do
|
||||
Result := age (req)
|
||||
Result := max_age (req)
|
||||
ensure
|
||||
not_more_than_1_year: Result <= Never_expires
|
||||
end
|
||||
|
||||
@@ -315,7 +315,7 @@ feature {NONE} -- Implementation
|
||||
create l_dur.make (0, 0, 0, 0, 0, l_age.as_integer_32)
|
||||
l_dt := (create {HTTP_DATE}.make_from_date_time (a_request_time + l_dur)).rfc1123_string
|
||||
a_header.put_header_key_value ({HTTP_HEADER_NAMES}.header_expires, l_dt)
|
||||
l_age_1 := a_handler.age (req)
|
||||
l_age_1 := a_handler.max_age (req)
|
||||
if l_age_1 /= l_age then
|
||||
a_header.add_header_key_value ({HTTP_HEADER_NAMES}.header_cache_control, "max-age=" + l_age_1.out)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user