From 589c7c49d896aa73558d94bc233d6f65527ecb11 Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Sat, 31 Aug 2013 00:06:42 +0200 Subject: Return 404 if file hash does not exist. --- fbin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fbin.py b/fbin.py index 1d70712..e6a2b3f 100755 --- a/fbin.py +++ b/fbin.py @@ -204,8 +204,8 @@ class Application(object): if '.' in hash: hash = hash.split('.')[0] file = self.get_file(hash, True) - filename = file.get_path() - if filename == None: + filename = file.get_path() if file else None + if file == None or filename == None: start_response('404 Not Found', [('Content-Type', 'text/html')]) return ['

Not Found

The file you requested does not exist.

'] -- cgit v1.2.3