Skip to content

Commit

Permalink
Check for internet before attempting to download APK
Browse files Browse the repository at this point in the history
  • Loading branch information
ayushmanchhabra committed Sep 7, 2024
1 parent cc625fe commit 43860d5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mobsf/MobSF/views/home.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
get_md5,
is_dir_exists,
is_file_exists,
is_internet_available,
is_md5,
is_safe_path,
key,
Expand Down Expand Up @@ -318,7 +319,9 @@ def recent_scans(request, page_size=10, page_number=1):
@login_required
@permission_required(Permissions.SCAN)
def download_apk(request):
"""Download and APK by package name."""
"""Download an APK by package name."""
if not is_internet_available():
return logger.warning(request, 'Internet Not Available. Unable to download APK')
package = request.POST['package']
# Package validated in apk_download()
context = {
Expand Down

0 comments on commit 43860d5

Please sign in to comment.