diff sat/plugins/plugin_comp_ap_gateway/http_server.py @ 3982:74f7c10a48bc

component AP gateway: properly close the HTTP connection on `checkSignature` exception: if something is going wrong during `checkSignature` (other than signature verification failing), a `500 Internal Server Error` code is returned, and the connection is properly closed.
author Goffi <goffi@goffi.org>
date Tue, 15 Nov 2022 18:10:33 +0100
parents acc9dfc8ba8d
children 31c3d6652115
line wrap: on
line diff
--- a/sat/plugins/plugin_comp_ap_gateway/http_server.py	Tue Nov 15 18:07:34 2022 +0100
+++ b/sat/plugins/plugin_comp_ap_gateway/http_server.py	Tue Nov 15 18:10:33 2022 +0100
@@ -1049,6 +1049,14 @@
             )
             request.finish()
             return
+        except Exception as e:
+            self.responseCode(
+                request,
+                http.INTERNAL_SERVER_ERROR,
+                f"Can't check signature: {e}"
+            )
+            request.finish()
+            return
 
         request.setResponseCode(http.ACCEPTED)