Continued reducing WGI and move implementation to WSF (Web Server Framework)
Removed many usage of READABLE_STRING_GENERAL in favor to READABLE_STRING_8 to avoid potential nasty issues in user's code URI-template is working only with STRING_8, then changed any _GENERAL or _STRING_32 to _STRING_8
This commit is contained in:
@@ -31,7 +31,7 @@ feature {NONE} -- Constants
|
||||
|
||||
feature -- Query
|
||||
|
||||
request_format (a_format_variable_name: detachable READABLE_STRING_GENERAL; content_type_supported: detachable ARRAY [READABLE_STRING_8]): detachable READABLE_STRING_8
|
||||
request_format (a_format_variable_name: detachable READABLE_STRING_8; content_type_supported: detachable ARRAY [READABLE_STRING_8]): detachable READABLE_STRING_8
|
||||
-- Format id for the request based on {HTTP_FORMAT_CONSTANTS}
|
||||
do
|
||||
if a_format_variable_name /= Void and then attached string_parameter (a_format_variable_name) as ctx_format then
|
||||
@@ -41,7 +41,7 @@ feature -- Query
|
||||
end
|
||||
end
|
||||
|
||||
request_format_id (a_format_variable_name: detachable READABLE_STRING_GENERAL; content_type_supported: detachable ARRAY [READABLE_STRING_8]): INTEGER
|
||||
request_format_id (a_format_variable_name: detachable READABLE_STRING_8; content_type_supported: detachable ARRAY [READABLE_STRING_8]): INTEGER
|
||||
-- Format id for the request based on {HTTP_FORMAT_CONSTANTS}
|
||||
do
|
||||
if attached request_format (a_format_variable_name, content_type_supported) as l_format then
|
||||
@@ -107,18 +107,18 @@ feature -- Query
|
||||
|
||||
feature -- Query
|
||||
|
||||
path_parameter (a_name: READABLE_STRING_GENERAL): detachable WSF_VALUE
|
||||
path_parameter (a_name: READABLE_STRING_8): detachable WSF_VALUE
|
||||
-- Parameter value for path variable `a_name'
|
||||
deferred
|
||||
end
|
||||
|
||||
query_parameter (a_name: READABLE_STRING_GENERAL): detachable WSF_VALUE
|
||||
query_parameter (a_name: READABLE_STRING_8): detachable WSF_VALUE
|
||||
-- Parameter value for query variable `a_name'
|
||||
--| i.e after the ? character
|
||||
deferred
|
||||
end
|
||||
|
||||
parameter (a_name: READABLE_STRING_GENERAL): detachable WSF_VALUE
|
||||
parameter (a_name: READABLE_STRING_8): detachable WSF_VALUE
|
||||
-- Any parameter value for variable `a_name'
|
||||
-- URI template parameter and query parameters
|
||||
do
|
||||
@@ -137,17 +137,17 @@ feature -- String query
|
||||
end
|
||||
end
|
||||
|
||||
string_path_parameter (a_name: READABLE_STRING_GENERAL): detachable READABLE_STRING_32
|
||||
string_path_parameter (a_name: READABLE_STRING_8): detachable READABLE_STRING_32
|
||||
do
|
||||
Result := string_from (path_parameter (a_name))
|
||||
end
|
||||
|
||||
string_query_parameter (a_name: READABLE_STRING_GENERAL): detachable READABLE_STRING_32
|
||||
string_query_parameter (a_name: READABLE_STRING_8): detachable READABLE_STRING_32
|
||||
do
|
||||
Result := string_from (query_parameter (a_name))
|
||||
end
|
||||
|
||||
string_parameter (a_name: READABLE_STRING_GENERAL): detachable READABLE_STRING_32
|
||||
string_parameter (a_name: READABLE_STRING_8): detachable READABLE_STRING_32
|
||||
do
|
||||
Result := string_from (parameter (a_name))
|
||||
end
|
||||
|
||||
@@ -23,11 +23,11 @@ feature {NONE} -- Initialization
|
||||
|
||||
feature -- Query
|
||||
|
||||
path_parameter (a_name: READABLE_STRING_GENERAL): detachable WSF_VALUE
|
||||
path_parameter (a_name: READABLE_STRING_8): detachable WSF_VALUE
|
||||
do
|
||||
end
|
||||
|
||||
query_parameter (a_name: READABLE_STRING_GENERAL): detachable WSF_VALUE
|
||||
query_parameter (a_name: READABLE_STRING_8): detachable WSF_VALUE
|
||||
do
|
||||
Result := request.query_parameter (a_name)
|
||||
end
|
||||
|
||||
@@ -31,14 +31,14 @@ feature -- Access
|
||||
|
||||
feature -- Query
|
||||
|
||||
path_parameter (a_name: READABLE_STRING_GENERAL): detachable WSF_VALUE
|
||||
path_parameter (a_name: READABLE_STRING_8): detachable WSF_VALUE
|
||||
do
|
||||
if attached uri_template_match.url_decoded_path_variable (a_name) as s then
|
||||
create {WSF_STRING_VALUE} Result.make (a_name, s)
|
||||
end
|
||||
end
|
||||
|
||||
query_parameter (a_name: READABLE_STRING_GENERAL): detachable WSF_VALUE
|
||||
query_parameter (a_name: READABLE_STRING_8): detachable WSF_VALUE
|
||||
do
|
||||
if attached uri_template_match.url_decoded_query_variable (a_name) as s then
|
||||
create {WSF_STRING_VALUE} Result.make (a_name, s)
|
||||
|
||||
@@ -57,8 +57,8 @@ feature {NONE} -- Access: Implementation
|
||||
handler (req: WSF_REQUEST): detachable TUPLE [handler: attached like default_handler; context: like default_handler_context]
|
||||
local
|
||||
l_handlers: like handlers
|
||||
t: STRING
|
||||
p: STRING
|
||||
t: READABLE_STRING_8
|
||||
p: READABLE_STRING_8
|
||||
l_req_method: READABLE_STRING_GENERAL
|
||||
l_res: URI_TEMPLATE_MATCH_RESULT
|
||||
do
|
||||
|
||||
Reference in New Issue
Block a user