Skip to content
Snippets Groups Projects
Verified Commit a35e0fa5 authored by Alexander Olofsson's avatar Alexander Olofsson
Browse files

application_service: Fix method routing

parent 8cbd3290
No related branches found
No related tags found
No related merge requests found
......@@ -118,17 +118,17 @@ module MatrixSdk
map = @method_map[req_method]
raise WEBrick::HTTPStatus[405], {}.to_json if map.nil?
method = map.find { |k, _v| k =~ req_uri }.last
method = map.find { |k, _v| k =~ req_uri.path }.last
match = Regexp.last_match
match = Hash[match.names.zip(match.captures)].merge(
match_hash = Hash[match.names.zip(match.captures)].merge(
request: request,
response: response
)
if method.is_a? Symbol
send method, match
send method, match_hash
else
method.call match
method.call match_hash
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment