Reviewed the semantic of the handler context.
Adapted existing code to fit the new router design.
This commit is contained in:
@@ -2,7 +2,7 @@ class
|
||||
REST_REQUEST_AGENT_HANDLER
|
||||
|
||||
inherit
|
||||
WSF_AGENT_URI_TEMPLATE_HANDLER
|
||||
WSF_URI_TEMPLATE_AGENT_HANDLER
|
||||
|
||||
create
|
||||
make
|
||||
|
||||
@@ -8,7 +8,7 @@ deferred class
|
||||
REST_REQUEST_HANDLER
|
||||
|
||||
inherit
|
||||
WSF_URI_TEMPLATE_HANDLER
|
||||
WSF_URI_TEMPLATE_CONTEXT_HANDLER [WSF_HANDLER_CONTEXT]
|
||||
|
||||
WSF_HANDLER_HELPER
|
||||
|
||||
|
||||
@@ -10,6 +10,8 @@ deferred class
|
||||
inherit
|
||||
WSF_HANDLER_CONTEXT
|
||||
|
||||
WSF_REQUEST_UTILITY
|
||||
|
||||
feature -- Accept: Content-Type
|
||||
|
||||
accepted_content_type: detachable READABLE_STRING_8
|
||||
@@ -23,7 +25,7 @@ feature -- Accept: Content-Type
|
||||
get_accepted_content_type (a_supported_content_types: detachable ARRAY [STRING_8])
|
||||
do
|
||||
if internal_accepted_content_type = Void then
|
||||
internal_accepted_content_type := request_accepted_content_type (a_supported_content_types)
|
||||
internal_accepted_content_type := request_accepted_content_type (request, a_supported_content_types)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -73,10 +75,10 @@ feature -- Format
|
||||
request_accepted_format (a_format_variable_name: detachable READABLE_STRING_8; a_supported_content_types: 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_item (a_format_variable_name) as ctx_format then
|
||||
Result := ctx_format.as_string_8
|
||||
if a_format_variable_name /= Void and then attached {WSF_STRING} request.item (a_format_variable_name) as ctx_format then
|
||||
Result := ctx_format.value
|
||||
else
|
||||
Result := request_format_from_content_type (request_accepted_content_type (a_supported_content_types))
|
||||
Result := request_format_from_content_type (request_accepted_content_type (request, a_supported_content_types))
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ class
|
||||
REST_REQUEST_URI_TEMPLATE_HANDLER_CONTEXT
|
||||
|
||||
inherit
|
||||
WSF_URI_TEMPLATE_HANDLER_CONTEXT
|
||||
WSF_HANDLER_CONTEXT
|
||||
|
||||
REST_REQUEST_HANDLER_CONTEXT
|
||||
|
||||
|
||||
Reference in New Issue
Block a user