From 80fdf0a6e6bcfd833f578e8a3a449f4d427154db Mon Sep 17 00:00:00 2001 From: Adrien Barbaresi Date: Thu, 11 Jan 2024 18:02:31 +0100 Subject: [PATCH] fix in clean_url(): remove whitespace (#77) --- courlan/clean.py | 4 ++-- tests/unit_tests.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/courlan/clean.py b/courlan/clean.py index fc68527..196ffab 100644 --- a/courlan/clean.py +++ b/courlan/clean.py @@ -64,8 +64,8 @@ def scrub_url(url: str) -> str: "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f" "\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f \r\n" ) - # clean the input string - url = url.replace("[ \t]+", "") + # strip space in input string + url = "".join(url.split()) # if url.startswith("