From 3ae898476f56690320e9fed6362a17aa2cc7d3aa Mon Sep 17 00:00:00 2001 From: Colin Adams Date: Fri, 16 Aug 2013 04:50:48 +0100 Subject: [PATCH] Changed age to max_age --- examples/restbucksCRUD/src/resource/order_handler.e | 2 +- library/server/wsf/router/wsf_caching_policy.e | 6 +++--- library/server/wsf/router/wsf_method_helper.e | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/restbucksCRUD/src/resource/order_handler.e b/examples/restbucksCRUD/src/resource/order_handler.e index 1ea6f836..91d1b9ae 100644 --- a/examples/restbucksCRUD/src/resource/order_handler.e +++ b/examples/restbucksCRUD/src/resource/order_handler.e @@ -99,7 +99,7 @@ feature -- Access Result.compare_objects end - 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. diff --git a/library/server/wsf/router/wsf_caching_policy.e b/library/server/wsf/router/wsf_caching_policy.e index bc9a4687..35f104de 100644 --- a/library/server/wsf/router/wsf_caching_policy.e +++ b/library/server/wsf/router/wsf_caching_policy.e @@ -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 diff --git a/library/server/wsf/router/wsf_method_helper.e b/library/server/wsf/router/wsf_method_helper.e index 165a4111..3f3037e8 100644 --- a/library/server/wsf/router/wsf_method_helper.e +++ b/library/server/wsf/router/wsf_method_helper.e @@ -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