Fixed a problem with missing extensions for external materials URLs, introduced in earlier doc.href() normalization work.

- Legacy-Id: 14077
This commit is contained in:
Henrik Levkowetz 2017-08-24 19:18:54 +00:00
parent f8581f7fc7
commit 4174196af0

View file

@ -554,6 +554,9 @@ def document_main(request, name, rev=None):
extension = os.path.splitext(g)[1]
t = os.path.splitext(g)[1].lstrip(".")
url = doc.href()
if not url.endswith("/") and not url.endswith(extension):
urlbase, urlext = os.path.splitext(url)
url = urlbase + extension
if extension == ".txt":
content = get_document_content(basename, pathname + extension, split=False)