Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sugar
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2007-08-31 18:32:33 (GMT)
committer Dan Williams <dcbw@redhat.com>2007-08-31 18:32:33 (GMT)
commit8c411ceb70688045baecb350a2cd453a0fc9f308 (patch)
tree30695dbae522604288352aebb29e9121cda23f62 /sugar
parent00ec48f21447205445aa2a34d31093a969cc549a (diff)
Return 404 error when path can't be translated
Diffstat (limited to 'sugar')
-rw-r--r--sugar/network.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/sugar/network.py b/sugar/network.py
index 77de95e..49d4882 100644
--- a/sugar/network.py
+++ b/sugar/network.py
@@ -144,6 +144,10 @@ class ChunkedGlibHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
** [dcbw] modified to send Content-disposition filename too
"""
path = self.translate_path(self.path)
+ if not path or not os.path.exists(path):
+ self.send_error(404, "File not found")
+ return None
+
f = None
if os.path.isdir(path):
for index in "index.html", "index.htm":