From f4db4812737bb423684704fcf9576f0b4639c198 Mon Sep 17 00:00:00 2001 From: Scott Wallace Date: Tue, 28 Dec 2021 16:36:04 +0000 Subject: [PATCH] More small fixes --- slinky/db.py | 3 ++- slinky/web.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) 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