1
0
mirror of https://github.com/mtrojnar/osslsigncode.git synced 2025-04-09 10:38:05 -05:00

tests: initialize resp_data

This commit is contained in:
olszomal 2023-11-22 09:12:13 +01:00 committed by Michał Trojnara
parent 588a1a0b5f
commit 7b60d6447d
2 changed files with 6 additions and 2 deletions

@ -43,6 +43,7 @@ class RequestHandler(SimpleHTTPRequestHandler):
self.send_response(200)
self.send_header("Content-type", "application/crl")
self.end_headers()
resp_data = b''
# Read the file and send the contents
if url.path == "/intermediateCA":
with open(CACRL, 'rb') as file:
@ -54,6 +55,7 @@ class RequestHandler(SimpleHTTPRequestHandler):
except Exception as err: # pylint: disable=broad-except
print(f"HTTP GET request error: {err}")
def do_POST(self): # pylint: disable=invalid-name
""""Serves the POST request type"""
try:
@ -76,7 +78,7 @@ class RequestHandler(SimpleHTTPRequestHandler):
openssl.check_returncode()
self.send_header("Content-type", "application/timestamp-reply")
self.end_headers()
resp_data = None
resp_data = b''
with open(RESPONS, mode="rb") as file:
resp_data = file.read()
self.wfile.write(resp_data)

@ -43,6 +43,7 @@ class RequestHandler(SimpleHTTPRequestHandler):
self.send_response(200)
self.send_header("Content-type", "application/crl")
self.end_headers()
resp_data = b''
# Read the file and send the contents
if url.path == "/intermediateCA":
with open(CACRL, 'rb') as file:
@ -54,6 +55,7 @@ class RequestHandler(SimpleHTTPRequestHandler):
except Exception as err: # pylint: disable=broad-except
print(f"HTTP GET request error: {err}")
def do_POST(self): # pylint: disable=invalid-name
""""Serves the POST request type"""
try:
@ -76,7 +78,7 @@ class RequestHandler(SimpleHTTPRequestHandler):
openssl.check_returncode()
self.send_header("Content-type", "application/timestamp-reply")
self.end_headers()
resp_data = None
resp_data = b''
with open(RESPONS, mode="rb") as file:
resp_data = file.read()
self.wfile.write(resp_data)