'Ensure headers and content have both been sent'

def finish_content(self):

    if (not self.headers_sent):
        self.headers['Content-Length'] = '0'
        self.send_headers()
    else:
        pass
