Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

thumbnail: Remove unused is_camo_url parameter.

Anders Kaseorg0b795e492fc7
diff --git a/stubs/taint/false_positives.pysa b/stubs/taint/false_positives.pysa
index ad5c3560997..75fc9531fe4 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 34401c893ec..dfc448098f2 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 c1bc7a5b384..86189fcae8d 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("<p>Not a valid URL.</p>")