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
|
||||
do
|
||||
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
|
||||
|
||||
feature {NONE} -- Routing
|
||||
|
||||
@@ -39,6 +39,8 @@ feature -- Registration
|
||||
end
|
||||
|
||||
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
|
||||
l_tpl: like {URI_TEMPLATE}.template
|
||||
l_uri: URI_TEMPLATE
|
||||
|
||||
Reference in New Issue
Block a user