diff --git a/vscoffline/server.py b/vscoffline/server.py index 7f7bee9..0ed118f 100644 --- a/vscoffline/server.py +++ b/vscoffline/server.py @@ -87,7 +87,7 @@ def on_get(self, req, resp): resp.status = falcon.HTTP_200 resp.content_type = 'application/octet-stream' with open(vsc.ARTIFACT_RECOMMENDATION, 'r') as f: - resp.body = f.read() + resp.text = f.read() class VSCMalicious(object): @@ -98,7 +98,7 @@ def on_get(self, req, resp): resp.status = falcon.HTTP_200 resp.content_type = 'application/octet-stream' with open(vsc.ARTIFACT_MALICIOUS, 'r') as f: - resp.body = f.read() + resp.text = f.read() class VSCGallery(object): @@ -353,7 +353,7 @@ def __init__(self): def on_get(self, req, resp): resp.content_type = 'text/html' with open('/opt/vscoffline/vscgallery/content/index.html', 'r') as f: - resp.body = f.read() + resp.text = f.read() resp.status = falcon.HTTP_200 class VSCDirectoryBrowse(object): @@ -370,9 +370,9 @@ def on_get(self, req, resp): resp.content_type = 'text/html' # Load template and replace variables with open('/opt/vscoffline/vscgallery/content/browse.html', 'r') as f: - resp.body = f.read() - resp.body = resp.body.replace('{PATH}', requested_path) - resp.body = resp.body.replace('{CONTENT}', self.simple_dir_browse_response(requested_path)) + resp.text = f.read() + resp.text = resp.text.replace('{PATH}', requested_path) + resp.text = resp.text.replace('{CONTENT}', self.simple_dir_browse_response(requested_path)) resp.status = falcon.HTTP_200 def simple_dir_browse_response(self, path):