mirror of
https://github.com/mtrojnar/osslsigncode.git
synced 2025-07-03 19:52:47 -05:00
tests: initialize resp_data
This commit is contained in:

committed by
Michał Trojnara

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