Skip to content

Commit

Permalink
Merge pull request #78 from LOLINTERNETZ/fix-gallery
Browse files Browse the repository at this point in the history
fix: 🐛 Fix gallery with updated falcon
  • Loading branch information
tristan-morris authored Jan 11, 2025
2 parents db9f764 + 2fc3abf commit a1af1e8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions vscoffline/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):

Expand All @@ -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):

Expand Down Expand Up @@ -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):
Expand All @@ -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):
Expand Down

0 comments on commit a1af1e8

Please sign in to comment.