pub fn validate_upgrade(head: &RequestHead) -> Result<String, UpgradeRejection>Expand description
Check a parsed request against RFC 6455 §4.2.1 and return the client’s
Sec-WebSocket-Key when it is a valid upgrade.
This is pure mechanics with no decision in it, so it never reaches the model — a request that is not a WebSocket handshake at all is answered with an HTTP error directly.