From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,NO_DNS_FOR_FROM, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from [10.7.7.5] (unknown [182.253.183.71]) by gnuweeb.org (Postfix) with ESMTPSA id AAD477E257; Wed, 19 Oct 2022 17:04:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1666199094; bh=qC1cyKJ046pAjR9Ghq7WSc/Xe1OybJzzVQ59b2PIgV0=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=Iadm3zHrg6vw9dlwfi7r9cgf4a3atjUUkrvkiaV5mNiFT0Xb9TTkX5xk6ic3PI4q1 qrf5/IlxLSpXTk8ZxKKN+r80Z7e4JSvvPJjKB744BRAkxsOOAUWW9CRXRjqoyPpbGM 0GVLhgg6qJ3ocXWps1hH/dq5pJA8MOo/xZRJGSXvOI+sNlYEho+TDTWrUNsFZTGVxQ OlEOold0nho3MGXwqznT3eIwuvFStfJaYDEONqybOZq4gTd0mXh/3USo7UWWR04xDE X1trCRxaEaF25jpWpr0DT3486u4JJbd984lWsG7E6sJHduimJr5Iq+B87EZfTH/6tL GoOmbsmiLHsiQ== Message-ID: <561e1fe5-469c-53ba-2c97-35605307e2fb@gnuweeb.org> Date: Thu, 20 Oct 2022 00:04:50 +0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [PATCH v1 6/7] atom: add manage_payload() Content-Language: en-US To: Muhammad Rizki Cc: Alviro Iskandar Setiawan , GNU/Weeb Mailing List References: <20221018081635.1617-1-kiizuha@gnuweeb.org> <20221018081635.1617-7-kiizuha@gnuweeb.org> From: Ammar Faizi In-Reply-To: <20221018081635.1617-7-kiizuha@gnuweeb.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: On 10/18/22 3:16 PM, Muhammad Rizki wrote: > +def manage_payload(payload: Message): > + p = str(payload.get_payload()) > + tf_encode = payload.get("Content-Transfer-Encoding") > + if tf_encode != "base64": > + return p.encode().decode("utf-8", errors="replace") > + return b64decode(p).decode("utf-8") What happen if we have "Content-Transfer-Encoding: quoted-printable"? Does this decode it properly? Example: https://lore.kernel.org/io-uring/20220908002616.3189675-1-shr@fb.com/raw -- Ammar Faizi