Mercurial > libervia-web
changeset 1456:284522d8af44
pages: check redirections for LiberviaPage.getURL:
rel 395
author | Goffi <goffi@goffi.org> |
---|---|
date | Wed, 29 Sep 2021 17:38:29 +0200 |
parents | e8c480b0078e |
children | 792a2e902ee9 |
files | libervia/server/pages.py |
diffstat | 1 files changed, 7 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/libervia/server/pages.py Wed Sep 29 10:31:59 2021 +0200 +++ b/libervia/server/pages.py Wed Sep 29 17:38:29 2021 +0200 @@ -665,11 +665,11 @@ else url.encode("utf-8"), ) - def getURL(self, *args): + def getURL(self, *args: str) -> str: """retrieve URL of the page set arguments - *args(list[unicode]): argument to add to the URL as path elements - empty or None arguments will be ignored + @param *args: arguments to add to the URL as path elements empty or None + arguments will be ignored """ url_args = [quote(a) for a in args if a] @@ -685,7 +685,10 @@ remaining_url = "/".join(remaining) return os.path.join("/", url_base, remaining_url) - return os.path.join(self.url, *url_args) + return self.host.checkRedirection( + self.vhost_root, + os.path.join(self.url, *url_args) + ) def getCurrentURL(self, request): """retrieve URL used to access this page