diff --git a/slinky/db.py b/slinky/db.py index cf68915..3f3c3fb 100644 --- a/slinky/db.py +++ b/slinky/db.py @@ -21,7 +21,7 @@ class ShortURL(Base): # type: ignore[misc, valid-type] # pylint: disable=too-f shortcode = Column(String(128), unique=True, nullable=False) url = Column(String(2048), unique=False, nullable=False) fixed_views = Column(Integer, unique=False, nullable=False) - expiry = Column(Integer, unique=False, nullable=False) + expiry = Column(String(26), unique=False, nullable=False) @dataclass @@ -29,6 +29,7 @@ class ShortcodeDB: """ Class to represent the database """ + url: str def session(self) -> Session: diff --git a/slinky/web.py b/slinky/web.py index 8a6166f..944ac78 100644 --- a/slinky/web.py +++ b/slinky/web.py @@ -90,7 +90,7 @@ def protect(func: Callable[..., Response]) -> Callable[..., Response]: return check_ip -@slinky_webapp.route('/') +@slinky_webapp.route('/', strict_slashes=False) def try_path_as_shortcode(path: str) -> Response: """ Try the initial path as a shortcode, redirect if found