Skip to content

Commit

Permalink
Fix path matching to ignore query strings (#1005)
Browse files Browse the repository at this point in the history
  • Loading branch information
leonaves authored and whummer committed Nov 22, 2018
1 parent 889ab3f commit 0589bab
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions localstack/services/apigateway/apigateway_listener.py
Expand Up @@ -142,6 +142,8 @@ def get_resource_for_path(path, path_map):
for api_path, details in path_map.items():
api_path_regex = re.sub(r'\{[^\+]+\+\}', r'[^\?#]+', api_path)
api_path_regex = re.sub(r'\{[^\}]+\}', r'[^/]+', api_path_regex)
# We aren't interested in matching against anything with query strings.
path = re.sub(r'\?.*', '', path)
if re.match(r'^%s$' % api_path_regex, path):
matches.append((api_path, details))
if not matches:
Expand Down

0 comments on commit 0589bab

Please sign in to comment.