Skip to content
Snippets Groups Projects
Commit 535ff9bb authored by developer23's avatar developer23
Browse files

commit

parent 6a071fd1
Branches
No related merge requests found
......@@ -77,8 +77,19 @@ class GetHandler(BaseHTTPRequestHandler):
def do_GET(self):
try:
self.WriteFile('/html/index.html')
try:
path = os.path.join(os.getcwd(), 'html')
for index in 'index.html', 'index.htm':
index = os.path.join(path, index)
if os.path.exists(index):
self.WriteFile(index)
else:
self.send_error(301)
self.send_header('Location', self.path)
self.end_headers()
return None
# self.WriteFile(path)
except IOError:
self.send_error(404, 'File Not Found: %s' % self.path)
return
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment