From 2fc3abfe391b67144848f8c212f2746c9df2d68d Mon Sep 17 00:00:00 2001 From: tristan-morris <44310937+tristan-morris@users.noreply.github.com> Date: Sat, 11 Jan 2025 15:26:33 +1100 Subject: [PATCH] fix: :bug: Fix gallery with updated falcon --- vscoffline/server.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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):