I'm writing a pretty basic webserver (well, trying) and while it's now serving HTML fine, my CSS files don't seem to be recognized at all. I have Apache2 running on my machine as well, and when I copy my files to the docroot, the pages are served correctly. I've also checked permissions and they seems to be fine. Here's the code I have so far:
class MyHandler(BaseHTTPRequestHandler):
def do_GET(self):
try:
if self.path == "/":
self.path = "/index.html"
if self.path == "favico.ico":
return
if self.path.endswith(".html"):
f = open(curdir+sep+self.path)
self.send_response(200)
self.send_header('Content-type', 'text/html')
self.end_headers()
self.wfile.write(f.read())
f.close()
return
return
except IOError:
self.send_error(404)
def do_POST(self):
...
Is there anything special I need to be doing in order to serve CSS files?
Thanks!