mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Address PrefixedUrlString bug in #1075
This commit is contained in:
parent
bf18b9ba17
commit
a4ca26a265
6 changed files with 16 additions and 2 deletions
|
|
@ -822,6 +822,9 @@ class Datasette:
|
|||
if url in seen_urls:
|
||||
continue
|
||||
seen_urls.add(url)
|
||||
if url.startswith("/"):
|
||||
# Take base_url into account:
|
||||
url = self.urls.path(url)
|
||||
if sri:
|
||||
output.append({"url": url, "sri": sri})
|
||||
else:
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import asyncio
|
||||
from contextlib import contextmanager
|
||||
import click
|
||||
from collections import OrderedDict, namedtuple
|
||||
import base64
|
||||
import click
|
||||
import hashlib
|
||||
import inspect
|
||||
import itertools
|
||||
|
|
@ -1016,8 +1016,11 @@ class PrefixedUrlString(str):
|
|||
def __add__(self, other):
|
||||
return type(self)(super().__add__(other))
|
||||
|
||||
def __str__(self):
|
||||
return super().__str__()
|
||||
|
||||
def __getattribute__(self, name):
|
||||
if name in dir(str):
|
||||
if not name.startswith("__") and name in dir(str):
|
||||
|
||||
def method(self, *args, **kwargs):
|
||||
value = getattr(super(), name)(*args, **kwargs)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue