From b30a558f13992c9324aba3ff888fff10a705fd7b Mon Sep 17 00:00:00 2001 From: Goffi Date: Tue, 15 Nov 2022 18:10:33 +0100 Subject: [PATCH] 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. --- sat/plugins/plugin_comp_ap_gateway/http_server.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sat/plugins/plugin_comp_ap_gateway/http_server.py b/sat/plugins/plugin_comp_ap_gateway/http_server.py index e484f803..2899d54f 100644 --- a/sat/plugins/plugin_comp_ap_gateway/http_server.py +++ b/sat/plugins/plugin_comp_ap_gateway/http_server.py @@ -1049,6 +1049,14 @@ class HTTPAPGServer(web_resource.Resource): ) 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)