Skip to content

Commit

Permalink
Merge pull request #49 from metricq/tilsche-regex
Browse files Browse the repository at this point in the history
fix: prevent `/` from enabling unlimited search regex mode
  • Loading branch information
tilsche authored May 30, 2022
2 parents 4987cd3 + 3f2aeb4 commit dcaef6c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion metricq_grafana/amqp.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ async def get_analyze_response(app, metric, start_time, end_time):
async def get_metric_list(app, search_query, metadata=False, limit=None):
time_begin = timer()
get_metrics_args = {"metadata": metadata, "historic": True}
if search_query.startswith("/") and search_query.endswith("/"):
if search_query.startswith("/") and search_query.endswith("/") and len(search_query) > 1:
get_metrics_args["selector"] = search_query[1:-1]
if limit:
get_metrics_args["limit"] = limit
Expand Down

0 comments on commit dcaef6c

Please sign in to comment.