Skip to content

Commit

Permalink
[32] Validate image content in raw content downloads
Browse files Browse the repository at this point in the history
CollinHeist committed Nov 11, 2024

Verified

This commit was signed with the committer’s verified signature.
CollinHeist Collin Heist
1 parent 8763d99 commit 9ff3b84
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions modules/WebInterface.py
Original file line number Diff line number Diff line change
@@ -257,9 +257,11 @@ def download_image(

# If content of image, just write directly to file
if isinstance(image, bytes):
destination.write_bytes(image)
log.trace(f'Downloaded {len(image):,} bytes')
return True
if WebInterface.verify_image_content('content', image):
destination.write_bytes(image)
log.trace(f'Downloaded {len(image):,} bytes')
return True
return False

# Attempt download
url = image
2 changes: 1 addition & 1 deletion modules/ref/version_webui
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2.0-alpha.13.0-webui31
v2.0-alpha.13.0-webui32

0 comments on commit 9ff3b84

Please sign in to comment.