Trying to figure out why gzip fails

This commit is contained in:
Jonas Linter
2025-09-29 10:24:56 +02:00
parent 52114a7443
commit b79288f6b6

View File

@@ -449,6 +449,16 @@ async def alpinebits_server_handshake(
try:
body = gzip.decompress(body)
logger.info("Successfully decompressed gzip content")
# log request to file like in wix-form/test
logs_dir = "logs"
if not os.path.exists(logs_dir):
os.makedirs(logs_dir, mode=0o755, exist_ok=True)
log_filename = f"{logs_dir}/alpinebits_request_{datetime.now().strftime('%Y%m%d_%H%M%S')}.xml"
with open(log_filename, "wb") as f:
f.write(body)
except Exception as e:
raise HTTPException(
status_code=400,