replace host_url with application_url

for url http://localhost/infra-optim
pecan.request.host_url is http://localhost
and pecan.request.application_url is http://localhost/infra-optim
we should use application_url to make href in links.

Change-Id: I5d7746b3da196ea2e072fbdf1adb1523ba2bffaf
Closes-Bug: #1854119
This commit is contained in:
licanwei
2019-11-27 14:47:19 +08:00
parent 89055577e6
commit 0032ed9237
3 changed files with 19 additions and 17 deletions

View File

@@ -23,7 +23,7 @@ from watcher.api.controllers import base
def build_url(resource, resource_args, bookmark=False, base_url=None):
if base_url is None:
base_url = pecan.request.host_url
base_url = pecan.request.application_url
template = '%(url)s/%(res)s' if bookmark else '%(url)s/v1/%(res)s'
# FIXME(lucasagomes): I'm getting a 404 when doing a GET on