Make sure to return a response
Added precondition to check URI_TEMPLATE is valid
This commit is contained in:
@@ -43,6 +43,9 @@ feature -- Execution
|
|||||||
hdl: detachable H
|
hdl: detachable H
|
||||||
do
|
do
|
||||||
hdl := router.dispatch_and_return_handler (req, res)
|
hdl := router.dispatch_and_return_handler (req, res)
|
||||||
|
if hdl = Void then
|
||||||
|
res.put_header ({HTTP_STATUS_CODE}.not_found, <<[{HTTP_HEADER_NAMES}.header_content_length, "0"]>>)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
feature {NONE} -- Routing
|
feature {NONE} -- Routing
|
||||||
|
|||||||
@@ -39,6 +39,8 @@ feature -- Registration
|
|||||||
end
|
end
|
||||||
|
|
||||||
map_with_uri_template_and_request_methods (uri: URI_TEMPLATE; h: H; rqst_methods: detachable ARRAY [READABLE_STRING_8])
|
map_with_uri_template_and_request_methods (uri: URI_TEMPLATE; h: H; rqst_methods: detachable ARRAY [READABLE_STRING_8])
|
||||||
|
require
|
||||||
|
uri_is_valid: uri.is_valid
|
||||||
local
|
local
|
||||||
l_tpl: like {URI_TEMPLATE}.template
|
l_tpl: like {URI_TEMPLATE}.template
|
||||||
l_uri: URI_TEMPLATE
|
l_uri: URI_TEMPLATE
|
||||||
|
|||||||
Reference in New Issue
Block a user