fix: avoid exception on GET request for ipasnhistory proxy

pull/17/head
Raphaël Vinot 2021-12-29 22:51:12 +01:00
parent 9d4fc9eda8
commit 26d8259182
1 changed files with 2 additions and 2 deletions

View File

@ -37,8 +37,8 @@ class IPASNProxy(Resource):
else:
full_path = request.full_path
path_for_ipasnhistory = full_path.replace('/ipasn_history/', '')
if path_for_ipasnhistory.startswith('/?'):
path_for_ipasnhistory = path_for_ipasnhistory.replace('/?', '/ip?')
if path_for_ipasnhistory.startswith('?'):
path_for_ipasnhistory = path_for_ipasnhistory.replace('?', 'ip?')
if not path_for_ipasnhistory:
path_for_ipasnhistory = 'ip'
return urljoin(get_config('generic', 'ipasnhistory_url'), path_for_ipasnhistory)