diff --git a/stubs/taint/false_positives.pysa b/stubs/taint/false_positives.pysa index ad5c356099..75fc9531fe 100644 --- a/stubs/taint/false_positives.pysa +++ b/stubs/taint/false_positives.pysa @@ -9,7 +9,6 @@ def zerver.views.auth.get_safe_redirect_to(url, redirect_host) -> Sanitize: ... def zerver.lib.thumbnail.generate_thumbnail_url( path, size=..., - is_camo_url=... ) -> Sanitize: ... # This function returns a version of name that only contains word and space diff --git a/zerver/lib/thumbnail.py b/zerver/lib/thumbnail.py index 34401c893e..dfc448098f 100644 --- a/zerver/lib/thumbnail.py +++ b/zerver/lib/thumbnail.py @@ -17,7 +17,7 @@ def user_uploads_or_external(url: str) -> bool: ) -def generate_thumbnail_url(path: str, size: str = "0x0", is_camo_url: bool = False) -> str: +def generate_thumbnail_url(path: str, size: str = "0x0") -> str: path = urljoin("/", path) if url_has_allowed_host_and_scheme(path, allowed_hosts=None): diff --git a/zerver/views/development/camo.py b/zerver/views/development/camo.py index c1bc7a5b38..86189fcae8 100644 --- a/zerver/views/development/camo.py +++ b/zerver/views/development/camo.py @@ -8,6 +8,6 @@ from zerver.lib.thumbnail import generate_thumbnail_url def handle_camo_url(request: HttpRequest, digest: str, received_url: str) -> HttpResponse: original_url = bytes.fromhex(received_url).decode() if is_camo_url_valid(digest, original_url): - return redirect(generate_thumbnail_url(original_url, is_camo_url=True)) + return redirect(generate_thumbnail_url(original_url)) else: return HttpResponseForbidden("

Not a valid URL.

")