From d2774095986e7c7fa58312c35bb4ae76e20f4500 Mon Sep 17 00:00:00 2001 From: huangzhenpc Date: Wed, 26 Feb 2025 13:46:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dtest=5Fsmtp=5Ffix.py=E4=B8=AD?= =?UTF-8?q?=E6=A3=80=E6=9F=A5=E9=82=AE=E7=AE=B1=E5=AD=98=E5=9C=A8=E9=80=BB?= =?UTF-8?q?=E8=BE=91=EF=BC=9A=E6=8E=A5=E5=8F=97HTTP=20201=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E7=A0=81=E4=B8=BA=E6=88=90=E5=8A=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test_smtp_fix.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test_smtp_fix.py b/test_smtp_fix.py index 071b6d1..7710527 100644 --- a/test_smtp_fix.py +++ b/test_smtp_fix.py @@ -133,9 +133,9 @@ def check_mailbox_exists(api_base_url, email_address): logger.info(f"检查/创建邮箱: {create_url}") response = requests.get(create_url) - if response.status_code == 200: - result = response.json() - if result.get('success'): + if response.status_code in [200, 201]: # 同时接受200和201状态码 + result = response.json() if response.content else {'success': True} + if result.get('success', True): # 默认为True,因为201状态可能没有返回JSON logger.info(f"邮箱检查/创建成功: {email_address}") return True, None else: