From 82d67a31b1c005371335910864b1235e0d53e120 Mon Sep 17 00:00:00 2001 From: JabLuszko Date: Sun, 22 Sep 2024 01:23:41 +0200 Subject: [PATCH] Update MadApkDownloadEndpoint.py --- .../endpoints/mad_apk/MadApkDownloadEndpoint.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mapadroid/mitm_receiver/endpoints/mad_apk/MadApkDownloadEndpoint.py b/mapadroid/mitm_receiver/endpoints/mad_apk/MadApkDownloadEndpoint.py index a555a1509..4622e01a5 100644 --- a/mapadroid/mitm_receiver/endpoints/mad_apk/MadApkDownloadEndpoint.py +++ b/mapadroid/mitm_receiver/endpoints/mad_apk/MadApkDownloadEndpoint.py @@ -2,6 +2,8 @@ from aiohttp import web +from loguru import logger + from mapadroid.mad_apk.utils import stream_package from mapadroid.mitm_receiver.endpoints.AbstractMitmReceiverRootEndpoint import AbstractMitmReceiverRootEndpoint @@ -16,20 +18,18 @@ class MadApkDownloadEndpoint(AbstractMitmReceiverRootEndpoint): # TODO: Auth/preprocessing for autoconfig? async def head(self): - logger.info("Device {} checking package {} (arch: {}) content-type", self.request.headers["origin"], - self.request.match_info.get('apk_type'), self.request.match_info.get('apk_arch')) data_generator, response = await self.__handle_download_request() return response async def get(self): + logger.info("Device {} downloading package {} (arch: {})", self.request.headers["origin"], + self.request.match_info.get('apk_type'), self.request.match_info.get('apk_arch')) data_generator, response = await self.__handle_download_request() async for data in data_generator: await response.write(data) return response async def __handle_download_request(self): - logger.info("Device {} downloading package {} (arch: {}) content-type", self.request.headers["origin"], - self.request.match_info.get('apk_type'), self.request.match_info.get('apk_arch')) parsed = self._parse_frontend() apk_type, apk_arch = parsed response = web.StreamResponse()