Skip to content
Snippets Groups Projects
Commit ebf50ac1 authored by Duncan Macleod's avatar Duncan Macleod Committed by Duncan Macleod
Browse files

api.v1: don't presume int or float in URLs

since `float` doesn't also catch `int` we don't want to encode every possible permutation (not that many, but the principle stands), just use `string` (default) and handle it later
parent 5d197789
No related branches found
No related tags found
No related merge requests found
Pipeline #521399 passed with warnings
...@@ -212,12 +212,9 @@ def find_url(ext, site, tag, filename): ...@@ -212,12 +212,9 @@ def find_url(ext, site, tag, filename):
)) ))
@blueprint.route('<ext>/<site>/<tag>/<int:start>,<int:end>') # for --ping @blueprint.route('<ext>/<site>/<tag>/<start>,<end>') # for --ping
@blueprint.route('<ext>/<site>/<tag>/<int:start>,<int:end>.json') @blueprint.route('<ext>/<site>/<tag>/<start>,<end>.json')
@blueprint.route('<ext>/<site>/<tag>/<int:start>,<int:end>/<urltype>.json') @blueprint.route('<ext>/<site>/<tag>/<start>,<end>/<urltype>.json')
@blueprint.route('<ext>/<site>/<tag>/<float:start>,<float:end>') # for --ping
@blueprint.route('<ext>/<site>/<tag>/<float:start>,<float:end>.json')
@blueprint.route('<ext>/<site>/<tag>/<float:start>,<float:end>/<urltype>.json')
@handle_errors_as_json @handle_errors_as_json
@authentication.validate @authentication.validate
def find_urls(ext, site, tag, start, end, urltype=None): def find_urls(ext, site, tag, start, end, urltype=None):
...@@ -269,7 +266,7 @@ def _find_urls(ext, site, tag, start, end, urltype=None, match=None, ...@@ -269,7 +266,7 @@ def _find_urls(ext, site, tag, start, end, urltype=None, match=None,
cache = get_dataset_cache(ext, site, tag) cache = get_dataset_cache(ext, site, tag)
# parse file paths # parse file paths
search = segment(start, end) search = segment(float(start), float(end))
lfns = defaultdict(list) lfns = defaultdict(list)
maxgps = -1e9 # something absurdly old maxgps = -1e9 # something absurdly old
for (path, cdur), seglist in cache.items(): for (path, cdur), seglist in cache.items():
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment