head file types

main
Bob Mottram 2019-12-03 22:08:20 +00:00
parent 7a506172b4
commit 4478b4f578
1 changed files with 25 additions and 1 deletions

View File

@ -3453,6 +3453,30 @@ class PubServer(BaseHTTPRequestHandler):
self._benchmarkGETtimings(GETstartTime,GETtimings,55)
def do_HEAD(self):
if self.path.endswith('.png'):
self._set_headers('image/png',0,None)
return
if self.path.endswith('.jpg') or self.path.endswith('.jpeg'):
self._set_headers('image/jpeg',0,None)
return
if self.path.endswith('.gif'):
self._set_headers('image/gif',0,None)
return
if self.path.endswith('.webp'):
self._set_headers('image/webp',0,None)
return
if self.path.endswith('.mp4'):
self._set_headers('video/mp4',0,None)
return
if self.path.endswith('.ogv'):
self._set_headers('video/ogv',0,None)
return
if self.path.endswith('.mp3'):
self._set_headers('audio/mpeg',0,None)
return
if self.path.endswith('.ogg'):
self._set_headers('audio/ogg',0,None)
return
self._set_headers('application/json',0,None)
def _receiveNewPostProcess(self,authorized: bool, \