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()