From b670057698e5cf5f009e9045a93933a37b2ac798 Mon Sep 17 00:00:00 2001 From: Elias Renman Date: Wed, 28 Jun 2023 20:48:38 +0200 Subject: [PATCH] fix: changed body collection --- pico-w/src/decorators.py | 18 +----------------- server/config.json | 2 +- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/pico-w/src/decorators.py b/pico-w/src/decorators.py index 5923ed8..648f839 100644 --- a/pico-w/src/decorators.py +++ b/pico-w/src/decorators.py @@ -66,24 +66,8 @@ Please note that this only supports content-type 'application/json' def get_body(request: str): req = request.split("\r\n") - content_length_index = 100 - out = "" - for index in range(len(req)): - item = req[index] + out = req[len(req) - 1] - if item.lower().find("content-type") != -1: - if not item.find("application/json"): - return - - if item.lower().find("content-length") != -1: - content_length_index = index - - if index > content_length_index: - out += item - out = out.replace("\n", "") - out = out.replace("\t", "") - - print("Output", out) if out != "": return out diff --git a/server/config.json b/server/config.json index 279f84e..2a70fa8 100644 --- a/server/config.json +++ b/server/config.json @@ -6,7 +6,7 @@ "moisture": { "thresholds": { "lower": { - "sensor_0": 50, + "sensor_0": 60, "sensor_1": 50, "sensor_2": 50 },