fix windows support in web_server.py for unit tests

This commit is contained in:
Arvid Norberg 2014-01-21 09:34:51 +00:00
parent 5d3c479e12
commit 41693bfa97
1 changed files with 2 additions and 2 deletions

View File

@ -25,7 +25,7 @@ class http_handler(SimpleHTTPServer.SimpleHTTPRequestHandler):
s.path = s.path[8:]
s.path = s.path[s.path.find('/'):]
s.path = os.path.normpath(s.path)
file_path = os.path.normpath(s.path)
if s.path == '/redirect':
s.send_response(301)
@ -79,7 +79,7 @@ class http_handler(SimpleHTTPServer.SimpleHTTPRequestHandler):
s.end_headers()
else:
try:
filename = s.path[1:]
filename = file_path[1:]
# serve file by invoking default handler
f = open(filename, 'rb')
size = int(os.stat(filename).st_size)