From b4ab4875fc5ebc5dacc4dc6868fa56dd5de59089 Mon Sep 17 00:00:00 2001 From: Colin Adams Date: Sat, 13 Apr 2013 14:48:28 +0100 Subject: [PATCH] If-Match implemented in skeleton handler --- .../specification/request/wgi_meta_names.e | 12 ++++++ .../ewsgi/specification/request/wgi_request.e | 32 +++++++++++++++- .../implementation/wgi_request_from_table.e | 38 ++++++++++++++++++- library/server/wsf/src/wsf_request.e | 36 ++++++++++++++++++ 4 files changed, 116 insertions(+), 2 deletions(-) diff --git a/library/server/ewsgi/specification/request/wgi_meta_names.e b/library/server/ewsgi/specification/request/wgi_meta_names.e index a4578a6b..c4f9ee81 100644 --- a/library/server/ewsgi/specification/request/wgi_meta_names.e +++ b/library/server/ewsgi/specification/request/wgi_meta_names.e @@ -54,6 +54,18 @@ feature -- Access http_if_match: STRING = "HTTP_IF_MATCH" + http_if_modified_since: STRING = "HTTP_IF_MODIFIED_SINCE" + + http_if_none_match: STRING = "HTTP_IF_NONE_MATCH" + + http_if_range: STRING = "HTTP_IF_RANGE" + + http_if_unmodified_since: STRING = "HTTP_IF_UNMODIFIED_SINCE" + + http_last_modified: STRING = "HTTP_LAST_MODIFIED" + + http_range: STRING = "HTTP_RANGE" + gateway_interface: STRING = "GATEWAY_INTERFACE" auth_type: STRING = "AUTH_TYPE" diff --git a/library/server/ewsgi/specification/request/wgi_request.e b/library/server/ewsgi/specification/request/wgi_request.e index d8b77a4c..d860b4e8 100644 --- a/library/server/ewsgi/specification/request/wgi_request.e +++ b/library/server/ewsgi/specification/request/wgi_request.e @@ -605,7 +605,37 @@ feature -- HTTP_* end http_if_match: detachable READABLE_STRING_8 - -- Existance check on resource + -- Existence check on resource + deferred + end + + http_if_modified_since: detachable READABLE_STRING_8 + -- Modification check on resource + deferred + end + + http_if_none_match: detachable READABLE_STRING_8 + -- Existence check on resource + deferred + end + + http_if_range: detachable READABLE_STRING_8 + -- Range check on resource + deferred + end + + http_if_unmodified_since: detachable READABLE_STRING_8 + -- Modification check on resource + deferred + end + + http_last_modified: detachable READABLE_STRING_8 + -- Modification time of resource + deferred + end + + http_range: detachable READABLE_STRING_8 + -- Requested byte-range of resource deferred end diff --git a/library/server/ewsgi/src/implementation/wgi_request_from_table.e b/library/server/ewsgi/src/implementation/wgi_request_from_table.e index 9f2fdec4..934f5e10 100644 --- a/library/server/ewsgi/src/implementation/wgi_request_from_table.e +++ b/library/server/ewsgi/src/implementation/wgi_request_from_table.e @@ -249,10 +249,46 @@ feature -- Access: HTTP_* CGI meta parameters - 1.1 end http_if_match: detachable READABLE_STRING_8 - -- Existance check on resource + -- Existence check on resource do Result := meta_string_variable ({WGI_META_NAMES}.http_if_match) end + + http_if_modified_since: detachable READABLE_STRING_8 + -- Modification check on resource + do + Result := meta_string_variable ({WGI_META_NAMES}.http_if_modified_since) + end + + http_if_none_match: detachable READABLE_STRING_8 + -- Existence check on resource + do + Result := meta_string_variable ({WGI_META_NAMES}.http_if_none_match) + end + + http_if_range: detachable READABLE_STRING_8 + -- Range check on resource + do + Result := meta_string_variable ({WGI_META_NAMES}.http_if_range) + end + + http_if_unmodified_since: detachable READABLE_STRING_8 + -- Modification check on resource + do + Result := meta_string_variable ({WGI_META_NAMES}.http_if_unmodified_since) + end + + http_last_modified: detachable READABLE_STRING_8 + -- Modification time of resource + do + Result := meta_string_variable ({WGI_META_NAMES}.http_last_modified) + end + + http_range: detachable READABLE_STRING_8 + -- Requested byte-range of resource + do + Result := meta_string_variable ({WGI_META_NAMES}.http_range) + end feature -- Access: Extension to CGI meta parameters - 1.1 diff --git a/library/server/wsf/src/wsf_request.e b/library/server/wsf/src/wsf_request.e index f460180a..cf8eaa73 100644 --- a/library/server/wsf/src/wsf_request.e +++ b/library/server/wsf/src/wsf_request.e @@ -1048,6 +1048,42 @@ feature -- HTTP_* Result := wgi_request.http_if_match end + http_if_modified_since: detachable READABLE_STRING_8 + -- Modification check on resource + do + Result := wgi_request.http_if_modified_since + end + + http_if_none_match: detachable READABLE_STRING_8 + -- Existence check on resource + do + Result := wgi_request.http_if_none_match + end + + http_if_range: detachable READABLE_STRING_8 + -- Range check on resource + do + Result := wgi_request.http_if_range + end + + http_if_unmodified_since: detachable READABLE_STRING_8 + -- Modification check on resource + do + Result := wgi_request.http_if_unmodified_since + end + + http_last_modified: detachable READABLE_STRING_8 + -- Modification time of resource + do + Result := wgi_request.http_last_modified + end + + http_range: detachable READABLE_STRING_8 + -- Requested byte-range of resource + do + Result := wgi_request.http_range + end + feature -- Extra CGI environment variables request_uri: READABLE_STRING_8