Changed age to max_age

This commit is contained in:
Colin Adams
2013-08-16 04:50:48 +01:00
parent eefe547553
commit 3ae898476f
3 changed files with 5 additions and 5 deletions

View File

@@ -99,7 +99,7 @@ feature -- Access
Result.compare_objects Result.compare_objects
end end
age (req: WSF_REQUEST): NATURAL max_age (req: WSF_REQUEST): NATURAL
-- Maximum age in seconds before response to `req` is considered stale; -- Maximum age in seconds before response to `req` is considered stale;
-- This is used to generate a Cache-Control: max-age header. -- This is used to generate a Cache-Control: max-age header.
-- Return 0 to indicate already expired. -- Return 0 to indicate already expired.

View File

@@ -14,7 +14,7 @@ feature -- Access
-- 525600 = 365 * 24 * 60 * 60 = (almost) 1 year; -- 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 -- 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; -- Maximum age in seconds before response to `req` is considered stale;
-- This is used to generate a Cache-Control: max-age header. -- This is used to generate a Cache-Control: max-age header.
-- Return 0 to indicate already expired. -- Return 0 to indicate already expired.
@@ -35,7 +35,7 @@ feature -- Access
require require
req_attached: req /= Void req_attached: req /= Void
do do
Result := age (req) Result := max_age (req)
ensure ensure
not_more_than_1_year: Result <= Never_expires not_more_than_1_year: Result <= Never_expires
end end
@@ -51,7 +51,7 @@ feature -- Access
require require
req_attached: req /= Void req_attached: req /= Void
do do
Result := age (req) Result := max_age (req)
ensure ensure
not_more_than_1_year: Result <= Never_expires not_more_than_1_year: Result <= Never_expires
end end

View File

@@ -315,7 +315,7 @@ feature {NONE} -- Implementation
create l_dur.make (0, 0, 0, 0, 0, l_age.as_integer_32) 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 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) 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 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) a_header.add_header_key_value ({HTTP_HEADER_NAMES}.header_cache_control, "max-age=" + l_age_1.out)
end end