From 17f2c9af3f7f69c881d92b65d51850a5d3c5f301 Mon Sep 17 00:00:00 2001 From: Recolic <git@me.recolic.net> Date: Mon, 25 Dec 2023 20:56:19 -0800 Subject: [PATCH] .PUT test --- httpd-standalone-ssl.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/httpd-standalone-ssl.py b/httpd-standalone-ssl.py index 5e46faa..8875f1d 100644 --- a/httpd-standalone-ssl.py +++ b/httpd-standalone-ssl.py @@ -101,6 +101,21 @@ class my_handler(http.server.BaseHTTPRequestHandler): self.send_header("Content-type", "text/plain; charset=utf-8") self.end_headers() self.wfile.write('invalid post query.'.encode('utf-8')) + def do_PUT(self): + self.send_response(200) + if self.path.startswith('/update_machine_status_v1'): + # I don't know what to send for this request... We need packet capture here! + # This problem cause green "Pay" button loading forever for SOME machine. + # Sending a guess reply... TODO: test if it's working fine. + self.send_header("content-type","application/json; charset=utf-8") + self.end_headers() + self.wfile.write('{"status":"ok","error":{"errorCode":0,"errorMessage":""},"notifications":[]}'.encode('utf-8')) + return + + self.send_response(403) + self.send_header("Content-type", "text/plain; charset=utf-8") + self.end_headers() + self.wfile.write('invalid put query.'.encode('utf-8')) try: -- GitLab