mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
New force_https_urls option, refs #333
This commit is contained in:
parent
4e82d0e64d
commit
f24b49a1a8
5 changed files with 44 additions and 11 deletions
|
|
@ -142,6 +142,12 @@ class BaseView(RenderMixin):
|
|||
|
||||
return name, expected, None
|
||||
|
||||
def absolute_url(self, request, path):
|
||||
url = urllib.parse.urljoin(request.url, path)
|
||||
if url.startswith("http://") and self.ds.config["force_https_urls"]:
|
||||
url = "https://" + url[len("http://"):]
|
||||
return url
|
||||
|
||||
def get_templates(self, database, table=None):
|
||||
assert NotImplemented
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue