'Verifies all invariant- and required headers
If a header is missing or have an incorrect value ValueError will be
raised'

def _handle_websocket_headers(self):

    fields = ('Host', 'Sec-Websocket-Key', 'Sec-Websocket-Version')
    if (not all(map((lambda f: self.request.headers.get(f)), fields))):
        raise ValueError('Missing/Invalid    WebSocket    headers')
