Skip to content

Commit

Permalink
404 when logo_path does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
supakeen committed Mar 9, 2024
1 parent c9abe81 commit 7003162
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/pinnwand/handler/website.py
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,10 @@ def initialize(self, path: str) -> None:
self.path = path

async def get(self) -> None:
self.set_header("Content-Type", "image/png")

with open(self.path, "rb") as f:
self.write(f.read())
try:
with open(self.path, "rb") as f:
self.write(f.read())
self.set_header("Content-Type", "image/png")
except FileNotFoundError:
raise tornado.web.HTTPError(404)

0 comments on commit 7003162

Please sign in to comment.