parameters: (self)
return_statement: return file_object
docstring: Common code for GET and HEAD commands.
  
      Override from SimpleHTTPRequestHandler.
docstring_summary: Common code for GET and HEAD commands.
docstring_tokens: Common code for GET and HEAD commands .
function: def send_head(self):
      """Common code for GET and HEAD commands.
  
      Override from SimpleHTTPRequestHandler.
      """
      path = sanitize_path(self.path)
      file_info = None
      file_object = None
      if path == '' or path.endswith('/'):
        path = posixpath.join('index.html')
  
      try:
        # Try and retrieve the info for the path, then open it.
        file_info = self._zip_file.getinfo(path)
        file_object = self._zip_file.open(file_info)
      except KeyError:
        self.send_error(404, "File not found")
        return None
  
      ctype = self.guess_type(path)
      self.send_response(200)
      self.send_header("Content-type", ctype)
      self.send_header("Content-Length", file_info.file_size)
      self.send_header("Last-Modified",
                       self.date_time_string_for_zipinfo(file_info))
      self.end_headers()
      return file_object
function_tokens: def send_head ( self ) : path = sanitize_path ( self . path ) file_info = None file_object = None if path == '' or path . endswith ( '/' ) : path = posixpath . join ( 'index.html' ) try : # Try and retrieve the info for the path, then open it. file_info = self . _zip_file . getinfo ( path ) file_object = self . _zip_file . open ( file_info ) except KeyError : self . send_error ( 404 , "File not found" ) return None ctype = self . guess_type ( path ) self . send_response ( 200 ) self . send_header ( "Content-type" , ctype ) self . send_header ( "Content-Length" , file_info . file_size ) self . send_header ( "Last-Modified" , self . date_time_string_for_zipinfo ( file_info ) ) self . end_headers ( ) return file_object