Added server version to HTTP headers

This commit is contained in:
Sebastian Lohff 2012-06-05 16:33:56 +02:00
parent 5e62b1783e
commit 4567570962
1 changed files with 2 additions and 0 deletions

View File

@ -40,6 +40,7 @@ def getDateStrNow():
class FileBaseHandler(BaseHTTPServer.BaseHTTPRequestHandler): class FileBaseHandler(BaseHTTPServer.BaseHTTPRequestHandler):
fileName = "Undefined" fileName = "Undefined"
blockSize = 1024 * 1024 blockSize = 1024 * 1024
server_version = "servefile/" + __version__
def checkAndDoRedirect(self): def checkAndDoRedirect(self):
""" If request didn't request self.fileName redirect to self.fileName. """ If request didn't request self.fileName redirect to self.fileName.
@ -126,6 +127,7 @@ class TarFileHandler(FileBaseHandler):
target = None target = None
compression = "none" compression = "none"
compressionMethods = ("none", "gzip", "bzip2") compressionMethods = ("none", "gzip", "bzip2")
server_version = "servefile/" + __version__
def do_HEAD(self): def do_HEAD(self):
if self.checkAndDoRedirect(): if self.checkAndDoRedirect():