@@ -68,10 +68,12 @@ def _do_post(self):
6868 if not self .headers ["Host" ] == "localhost" :
6969 data = "Unexpected host"
7070 self ._send_reply (data .encode ("utf-8" ))
71+ return
7172
7273 if not self ._validate_signature (self .headers , raw_input ):
7374 data = "Bad Signature"
7475 self ._send_reply (data .encode ("utf-8" ))
76+ return
7577
7678 # X-Amz-Target: TrentService.Encrypt
7779 aws_operation = self .headers ['X-Amz-Target' ]
@@ -85,6 +87,7 @@ def _do_post(self):
8587 else :
8688 data = "Unknown AWS Operation"
8789 self ._send_reply (data .encode ("utf-8" ))
90+ return
8891
8992 def _validate_signature (self , headers , raw_input ):
9093 auth_header = headers ["Authorization" ]
@@ -130,6 +133,7 @@ def _do_encrypt(self, raw_input):
130133 }
131134
132135 self ._send_reply (json .dumps (response ).encode ('utf-8' ))
136+ return
133137
134138 def _do_encrypt_faults (self , raw_ciphertext ):
135139 kms_http_common .stats .fault_calls += 1
@@ -186,6 +190,7 @@ def _do_decrypt(self, raw_input):
186190 }
187191
188192 self ._send_reply (json .dumps (response ).encode ('utf-8' ))
193+ return
189194
190195 def _do_decrypt_faults (self , blob ):
191196 kms_http_common .stats .fault_calls += 1
0 commit comments