Merge branch 'master' into skeleton_router
This commit is contained in:
@@ -228,7 +228,7 @@ feature -- Status report
|
||||
end
|
||||
|
||||
item_associated_with_resource (a_resource: READABLE_STRING_8; rqst_methods: detachable WSF_REQUEST_METHODS): detachable WSF_ROUTER_ITEM
|
||||
-- Handler and request methods for `a_resource', taking into account `rqst_methods'
|
||||
-- First handler for `a_resource', taking into account `rqst_methods'
|
||||
require
|
||||
a_resource_attached: a_resource /= Void
|
||||
local
|
||||
@@ -259,6 +259,37 @@ feature -- Status report
|
||||
end
|
||||
end
|
||||
|
||||
items_associated_with_resource (a_resource: READABLE_STRING_8; rqst_methods: detachable WSF_REQUEST_METHODS): LIST [WSF_ROUTER_ITEM]
|
||||
-- All handlers for `a_resource', taking into account `rqst_methods'
|
||||
require
|
||||
a_resource_attached: a_resource /= Void
|
||||
local
|
||||
m: WSF_ROUTER_MAPPING
|
||||
ok: BOOLEAN
|
||||
do
|
||||
create {ARRAYED_LIST [WSF_ROUTER_ITEM]} Result.make (1)
|
||||
across
|
||||
mappings as c
|
||||
loop
|
||||
m := c.item.mapping
|
||||
ok := True
|
||||
if rqst_methods /= Void then
|
||||
if attached c.item.request_methods as l_item_rqst_methods then
|
||||
ok := across rqst_methods as mtd some is_matching_request_methods (mtd.item, l_item_rqst_methods) end
|
||||
else
|
||||
ok := True
|
||||
end
|
||||
end
|
||||
if ok then
|
||||
if attached {WSF_ROUTING_HANDLER} m.handler as l_routing then
|
||||
Result.append (l_routing.router.items_associated_with_resource (a_resource, rqst_methods))
|
||||
elseif m.associated_resource.same_string (a_resource) then
|
||||
Result.force (c.item)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
allowed_methods_for_request (req: WSF_REQUEST): WSF_REQUEST_METHODS
|
||||
-- Allowed methods for `req'
|
||||
require
|
||||
|
||||
Reference in New Issue
Block a user