mirror of https://github.com/zulip/zulip.git
thumbnail: Remove unused is_camo_url parameter.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
parent
4206e5f00b
commit
0b795e492f
|
@ -9,7 +9,6 @@ def zerver.views.auth.get_safe_redirect_to(url, redirect_host) -> Sanitize: ...
|
||||||
def zerver.lib.thumbnail.generate_thumbnail_url(
|
def zerver.lib.thumbnail.generate_thumbnail_url(
|
||||||
path,
|
path,
|
||||||
size=...,
|
size=...,
|
||||||
is_camo_url=...
|
|
||||||
) -> Sanitize: ...
|
) -> Sanitize: ...
|
||||||
|
|
||||||
# This function returns a version of name that only contains word and space
|
# This function returns a version of name that only contains word and space
|
||||||
|
|
|
@ -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)
|
path = urljoin("/", path)
|
||||||
|
|
||||||
if url_has_allowed_host_and_scheme(path, allowed_hosts=None):
|
if url_has_allowed_host_and_scheme(path, allowed_hosts=None):
|
||||||
|
|
|
@ -8,6 +8,6 @@ from zerver.lib.thumbnail import generate_thumbnail_url
|
||||||
def handle_camo_url(request: HttpRequest, digest: str, received_url: str) -> HttpResponse:
|
def handle_camo_url(request: HttpRequest, digest: str, received_url: str) -> HttpResponse:
|
||||||
original_url = bytes.fromhex(received_url).decode()
|
original_url = bytes.fromhex(received_url).decode()
|
||||||
if is_camo_url_valid(digest, original_url):
|
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:
|
else:
|
||||||
return HttpResponseForbidden("<p>Not a valid URL.</p>")
|
return HttpResponseForbidden("<p>Not a valid URL.</p>")
|
||||||
|
|
Loading…
Reference in New Issue