Fixed issues in WGI_REQUEST's invariant
Fixed issues with guessing the default format for REST handling Fixed issue with .._ROUTING_.. component.
This commit is contained in:
@@ -96,6 +96,16 @@ feature -- Access: CGI meta variables
|
||||
deferred
|
||||
end
|
||||
|
||||
meta_string_variable (a_name: READABLE_STRING_GENERAL): detachable READABLE_STRING_32
|
||||
-- Environment variable related to `a_name'
|
||||
require
|
||||
a_name_valid: a_name /= Void and then not a_name.is_empty
|
||||
do
|
||||
if attached meta_variable (a_name) as val then
|
||||
Result := val.as_string
|
||||
end
|
||||
end
|
||||
|
||||
meta_variables: ITERATION_CURSOR [WGI_VALUE]
|
||||
-- These variables are specific to requests made with HTTP.
|
||||
-- Interpretation of these variables may depend on the value of
|
||||
@@ -687,10 +697,10 @@ invariant
|
||||
query_string_attached: query_string /= Void
|
||||
remote_addr_attached: remote_addr /= Void
|
||||
|
||||
same_orig_path_info: orig_path_info ~ meta_variable ({WGI_META_NAMES}.orig_path_info)
|
||||
same_path_info: path_info ~ meta_variable ({WGI_META_NAMES}.path_info)
|
||||
same_orig_path_info: orig_path_info ~ meta_string_variable ({WGI_META_NAMES}.orig_path_info)
|
||||
same_path_info: path_info ~ meta_string_variable ({WGI_META_NAMES}.path_info)
|
||||
|
||||
path_info_identical: path_info ~ meta_variable ({WGI_META_NAMES}.path_info)
|
||||
path_info_identical: path_info ~ meta_string_variable ({WGI_META_NAMES}.path_info)
|
||||
|
||||
note
|
||||
copyright: "2011-2011, Eiffel Software and others"
|
||||
|
||||
@@ -185,14 +185,6 @@ feature -- Access: CGI meta parameters
|
||||
Result := meta_variables_table.item (a_name)
|
||||
end
|
||||
|
||||
meta_string_variable (a_name: READABLE_STRING_GENERAL): detachable READABLE_STRING_32
|
||||
-- CGI meta variable related to `a_name'
|
||||
do
|
||||
if attached meta_variables_table.item (a_name) as val then
|
||||
Result := val.as_string
|
||||
end
|
||||
end
|
||||
|
||||
meta_string_variable_or_default (a_name: READABLE_STRING_GENERAL; a_default: READABLE_STRING_32; use_default_when_empty: BOOLEAN): READABLE_STRING_32
|
||||
-- Value for meta parameter `a_name'
|
||||
-- If not found, return `a_default'
|
||||
@@ -325,8 +317,6 @@ feature -- Access: HTTP_* CGI meta parameters - 1.1
|
||||
-- Contents of the Host: header from the current request, if there is one.
|
||||
do
|
||||
Result := meta_string_variable ({WGI_META_NAMES}.http_host)
|
||||
ensure
|
||||
Result /= Void
|
||||
end
|
||||
|
||||
http_referer: detachable READABLE_STRING_32
|
||||
|
||||
@@ -31,7 +31,7 @@ feature -- Execution
|
||||
|
||||
execute (ctx: C; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER)
|
||||
do
|
||||
Precursor {REST_REQUEST_HANDLER} (ctx, req, res)
|
||||
Precursor {REQUEST_URI_ROUTING_HANDLER_I} (ctx, req, res)
|
||||
end
|
||||
|
||||
execute_application (ctx: C; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER)
|
||||
|
||||
@@ -38,7 +38,7 @@ feature -- Execution
|
||||
|
||||
execute (ctx: C; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER)
|
||||
do
|
||||
Precursor {REST_REQUEST_HANDLER} (ctx, req, res)
|
||||
Precursor {REQUEST_URI_TEMPLATE_ROUTING_HANDLER_I} (ctx, req, res)
|
||||
end
|
||||
|
||||
execute_application (ctx: C; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER)
|
||||
|
||||
@@ -98,6 +98,8 @@ feature -- Query
|
||||
end
|
||||
i := i + 1
|
||||
end
|
||||
else
|
||||
Result := s
|
||||
end
|
||||
l_accept_lst.forth
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user