Skip to content

Commit a1af1e8

Browse files
Merge pull request #78 from LOLINTERNETZ/fix-gallery
fix: 🐛 Fix gallery with updated falcon
2 parents db9f764 + 2fc3abf commit a1af1e8

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

vscoffline/server.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def on_get(self, req, resp):
8787
resp.status = falcon.HTTP_200
8888
resp.content_type = 'application/octet-stream'
8989
with open(vsc.ARTIFACT_RECOMMENDATION, 'r') as f:
90-
resp.body = f.read()
90+
resp.text = f.read()
9191

9292
class VSCMalicious(object):
9393

@@ -98,7 +98,7 @@ def on_get(self, req, resp):
9898
resp.status = falcon.HTTP_200
9999
resp.content_type = 'application/octet-stream'
100100
with open(vsc.ARTIFACT_MALICIOUS, 'r') as f:
101-
resp.body = f.read()
101+
resp.text = f.read()
102102

103103
class VSCGallery(object):
104104

@@ -353,7 +353,7 @@ def __init__(self):
353353
def on_get(self, req, resp):
354354
resp.content_type = 'text/html'
355355
with open('/opt/vscoffline/vscgallery/content/index.html', 'r') as f:
356-
resp.body = f.read()
356+
resp.text = f.read()
357357
resp.status = falcon.HTTP_200
358358

359359
class VSCDirectoryBrowse(object):
@@ -370,9 +370,9 @@ def on_get(self, req, resp):
370370
resp.content_type = 'text/html'
371371
# Load template and replace variables
372372
with open('/opt/vscoffline/vscgallery/content/browse.html', 'r') as f:
373-
resp.body = f.read()
374-
resp.body = resp.body.replace('{PATH}', requested_path)
375-
resp.body = resp.body.replace('{CONTENT}', self.simple_dir_browse_response(requested_path))
373+
resp.text = f.read()
374+
resp.text = resp.text.replace('{PATH}', requested_path)
375+
resp.text = resp.text.replace('{CONTENT}', self.simple_dir_browse_response(requested_path))
376376
resp.status = falcon.HTTP_200
377377

378378
def simple_dir_browse_response(self, path):

0 commit comments

Comments
 (0)