Skip to content

Commit

Permalink
use partial url
Browse files Browse the repository at this point in the history
  • Loading branch information
rwxzhu committed Feb 16, 2024
1 parent c2d64a6 commit e651398
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion deploy-board/deploy_board/webapp/util_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ def validate_metrics_url(request):
url = request.POST['newEntryValue']
if not url.startswith(STATSBOARD_API_PREFIX):
return HttpResponse(json.dumps({'result': False}), content_type="application/json")
response = urllib.request.urlopen(url)
subpath = url.replace(STATSBOARD_API_PREFIX, '')
response = urllib.request.urlopen(STATSBOARD_API_PREFIX + subpath)
data = json.loads(response.read().decode('utf-8'))
if len(data) > 0:
data = data[0]
Expand Down

0 comments on commit e651398

Please sign in to comment.