Roxen.git / server / modules / misc / websocket.pike

version» Context lines:

Roxen.git/server/modules/misc/websocket.pike:125:    id->register_vary_callback("sec-websocket-key", has_valid_websocket_key);       if (!has_valid_websocket_key("", id)) {    // Invalid Sec-WebSocet-Key.    TRACE_LEAVE("No - Invalid Sec-WebSocket-Key.");    return Roxen.http_status(Protocols.HTTP.HTTP_BAD,    "Invalid Sec-WebSocket-Key.");    }       // FIXME: Fix vary support for http version. +  // Note also that the varies header was added in HTTP/1.1.    if (!has_prefix(id->prot, "HTTP/") ||    (id->prot[sizeof("HTTP/")..] < "1.1")) {    // HTTP/1.1 or later required.    NOCACHE();    TRACE_LEAVE("No - not HTTP/1.1 or later.");    return 0;    }       TRACE_LEAVE("Yes.");       // NB: The mixed case in the method ensures that it can't be    // set directly from the http request.    id->method = "WebSocketOpen";    id->misc->error_code = Protocols.HTTP.HTTP_BAD;       // Continue request processing.    return 0;   }