diff options
author | Jon Bergli Heier <snakebite@jvnv.net> | 2013-08-31 00:06:42 +0200 |
---|---|---|
committer | Jon Bergli Heier <snakebite@jvnv.net> | 2013-08-31 00:06:42 +0200 |
commit | 589c7c49d896aa73558d94bc233d6f65527ecb11 (patch) | |
tree | f33ddbf7d932b2826e7edfd8e4474d5a2e8bd3b7 | |
parent | 143f638a4b1bafdc4a2a811a9f4c97a5392a0acc (diff) |
Return 404 if file hash does not exist.
-rwxr-xr-x | fbin.py | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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 ['<h1>Not Found</h1><p>The file you requested does not exist.</p>'] |