From 7713b0cbbe241fe7c50c61adfc9fe96288a8d46d Mon Sep 17 00:00:00 2001 From: proffapt Date: Tue, 6 Aug 2024 15:57:13 +0530 Subject: [PATCH] fix: bypassing 4MB limit for message body --- mftp-doctor/mftp-doctor.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mftp-doctor/mftp-doctor.py b/mftp-doctor/mftp-doctor.py index ae1f4b7..3b761be 100644 --- a/mftp-doctor/mftp-doctor.py +++ b/mftp-doctor/mftp-doctor.py @@ -2,6 +2,7 @@ import time import docker import logging +from flask import request import requests import argparse from datetime import datetime @@ -52,6 +53,9 @@ def check_error(logs): def send_notification(logs): + query_params = f"message={logs}" + request_url = f"{TOPIC_URL}?{query_params}" + headers = { "Priority": "5", "Tags": "warning,skull,rotating_light,mftp,error", @@ -62,8 +66,7 @@ def send_notification(logs): if EMAIL: headers["Email"] = EMAIL - response = requests.post(TOPIC_URL, headers=headers, - data=logs) + response = requests.put(request_url, headers=headers) return response.status_code