Merge branch 'master' into v1

This commit is contained in:
2015-06-08 10:10:51 +02:00
73 changed files with 5913 additions and 82 deletions

View File

@@ -47,26 +47,22 @@ feature -- Documentation
feature -- Status
is_mapping (req: WSF_REQUEST; a_router: WSF_ROUTER): BOOLEAN
is_mapping (a_path: READABLE_STRING_8; req: WSF_REQUEST; a_router: WSF_ROUTER): BOOLEAN
-- <Precursor>
local
p: READABLE_STRING_8
s: like based_uri
do
p := path_from_request (req)
s := based_uri (uri, a_router)
Result := p.starts_with (s)
Result := a_path.starts_with (s)
end
try (req: WSF_REQUEST; res: WSF_RESPONSE; sess: WSF_ROUTER_SESSION; a_router: WSF_ROUTER)
try (a_path: READABLE_STRING_8; req: WSF_REQUEST; res: WSF_RESPONSE; sess: WSF_ROUTER_SESSION; a_router: WSF_ROUTER)
-- <Precursor>
local
p: READABLE_STRING_8
s: like based_uri
do
p := path_from_request (req)
s := based_uri (uri, a_router)
if p.starts_with (s) then
if a_path.starts_with (s) then
sess.set_dispatched_handler (handler)
a_router.execute_before (Current)
execute_handler (handler, s, req, res)
@@ -113,7 +109,7 @@ invariant
uri_attached: uri /= Void
note
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
copyright: "2011-2015, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[
Eiffel Software

View File

@@ -50,13 +50,13 @@ feature -- Documentation
feature -- Status
is_mapping (req: WSF_REQUEST; a_router: WSF_ROUTER): BOOLEAN
is_mapping (a_path: READABLE_STRING_8; req: WSF_REQUEST; a_router: WSF_ROUTER): BOOLEAN
-- <Precursor>
local
p: READABLE_STRING_8
l_uri: like uri
do
p := path_from_request (req)
p := a_path
l_uri := based_uri (uri, a_router)
if l_uri.ends_with ("/") then
if not p.ends_with ("/") then
@@ -72,10 +72,10 @@ feature -- Status
end
end
try (req: WSF_REQUEST; res: WSF_RESPONSE; sess: WSF_ROUTER_SESSION; a_router: WSF_ROUTER)
try (a_path: READABLE_STRING_8; req: WSF_REQUEST; res: WSF_RESPONSE; sess: WSF_ROUTER_SESSION; a_router: WSF_ROUTER)
-- <Precursor>
do
if is_mapping (req, a_router) then
if is_mapping (a_path, req, a_router) then
sess.set_dispatched_handler (handler)
a_router.execute_before (Current)
execute_handler (handler, req, res)
@@ -106,7 +106,7 @@ feature {NONE} -- Implementation
end
note
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
copyright: "2011-2015, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[
Eiffel Software

View File

@@ -57,36 +57,32 @@ feature -- Documentation
feature -- Status
is_mapping (req: WSF_REQUEST; a_router: WSF_ROUTER): BOOLEAN
is_mapping (a_path: READABLE_STRING_8; req: WSF_REQUEST; a_router: WSF_ROUTER): BOOLEAN
-- <Precursor>
local
tpl: URI_TEMPLATE
p: READABLE_STRING_8
do
p := path_from_request (req)
tpl := based_uri_template (template, a_router)
Result := tpl.match (p) /= Void
Result := tpl.match (a_path) /= Void
end
try (req: WSF_REQUEST; res: WSF_RESPONSE; sess: WSF_ROUTER_SESSION; a_router: WSF_ROUTER)
try (a_path: READABLE_STRING_8; req: WSF_REQUEST; res: WSF_RESPONSE; sess: WSF_ROUTER_SESSION; a_router: WSF_ROUTER)
-- <Precursor>
local
tpl: URI_TEMPLATE
p: READABLE_STRING_8
new_src: detachable WSF_REQUEST_PATH_PARAMETERS_PROVIDER
do
p := path_from_request (req)
tpl := based_uri_template (template, a_router)
if attached tpl.match (p) as tpl_res then
if attached tpl.match (a_path) as tpl_res then
sess.set_dispatched_handler (handler)
a_router.execute_before (Current)
--| Applied the context to the request
--| in practice, this will fill the {WSF_REQUEST}.path_parameters
--| Applied the context to the request
--| in practice, this will fill the {WSF_REQUEST}.path_parameters
create new_src.make (tpl_res.path_variables.count, tpl_res.path_variables)
new_src.apply (req)
execute_handler (handler, req, res)
--| Revert {WSF_REQUEST}.path_parameters_source to former value
--| In case the request object passed by other handler that alters its values.
--| Revert {WSF_REQUEST}.path_parameters_source to former value
--| In case the request object passed by other handler that alters its values.
new_src.revert (req)
a_router.execute_after (Current)
end
@@ -126,7 +122,7 @@ feature {NONE} -- Implementation
end
note
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
copyright: "2011-2015, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[
Eiffel Software