'Common code for GET and HEAD commands
This sends the response code and MIME headers and returns either a
bytestring of content or, if none is found, None.'

def send_head(self):

    path = self.path[1:]
    content = self.resources.get(path)
    if (content is None):
        self.send_error(404, ('Path    "%s"    not    found    in    self.resources' % path))
    else:
        self.send_response(200)
        self.send_header('Content-type', 'text/plain')
        self.send_header('Content-Length', str(len(content)))
        self.end_headers()
        return content
