comparison MoinMoin/server/standalone.py @ 15:5a2a8201bb6f

make moin friendlier to proxies, thanks to ASF imported from: moin--main--1.5--patch-16
author Thomas Waldmann <tw@waldmann-edv.de>
date Fri, 23 Sep 2005 20:02:07 +0000
parents 77665d8e2254
children 2202f548cbb0
comparison
equal deleted inserted replaced
14:c8a7e012ebeb 15:5a2a8201bb6f
35 """ 35 """
36 36
37 # Imports 37 # Imports
38 import os, sys, time, urllib, socket, errno, shutil 38 import os, sys, time, urllib, socket, errno, shutil
39 import BaseHTTPServer, SimpleHTTPServer, SocketServer 39 import BaseHTTPServer, SimpleHTTPServer, SocketServer
40 from email.Utils import formatdate
41 40
42 # MoinMoin imports 41 # MoinMoin imports
43 from MoinMoin import version 42 from MoinMoin import version
44 from MoinMoin.server import Config, switchUID 43 from MoinMoin.server import Config, switchUID
45 from MoinMoin.request import RequestStandAlone 44 from MoinMoin.request import RequestStandAlone
45 from MoinMoin.util.datetime import formathttpdate
46 46
47 # Server globals 47 # Server globals
48 httpd = None 48 httpd = None
49 config = None 49 config = None
50 50
369 def end_headers(self): 369 def end_headers(self):
370 """overload the default end_headers, inserting expires header""" 370 """overload the default end_headers, inserting expires header"""
371 if self.expires: 371 if self.expires:
372 now = time.time() 372 now = time.time()
373 expires = now + self.expires 373 expires = now + self.expires
374 self.send_header('Expires', formatdate(expires)) 374 self.send_header('Expires', formathttpdate(expires))
375 SimpleHTTPServer.SimpleHTTPRequestHandler.end_headers(self) 375 SimpleHTTPServer.SimpleHTTPRequestHandler.end_headers(self)
376 376
377 def copyfile(self, source, outputfile): 377 def copyfile(self, source, outputfile):
378 """Copy all data between two file objects. 378 """Copy all data between two file objects.
379 379