diff --git a/caricari/private.py b/caricari/private.py index f8e1423..44fb8a7 100644 --- a/caricari/private.py +++ b/caricari/private.py @@ -58,11 +58,13 @@ def normalize_filename(filename: str): 'ciao' >>> normalize_filename("Hello, 42 worlds!") 'Hello42worlds' + >>> normalize_filename("Hey, do you want to hear my story?" * 10) + 'HeydoyouwanttohearmystoryHeydo' """ return "".join( c for c in filename if c.isalnum() or c in '-_' - ) + )[:40] @app.post("/upload") async def upload(