Proyecto

General

Perfil

from BaseHTTPServer import BaseHTTPRequestHandler
import os

class MyHandler(BaseHTTPRequestHandler):

def do_GET(self):
try:
if self.path.endswith(".iso") or self.path.endswith(".md5"):
file = "/var/lib/autoclone/www/" + self.path
f = open(file)
s = os.path.getsize(file)

self.send_response(200)
self.send_header('Content-type', 'application/x-iso9660-image')
self.send_header('Content-Length', s)
self.end_headers()

f.close()
return
except IOError:
pass
(2-2/4)