upgrade_response_headers

Function upgrade_response_headers 

Source
pub fn upgrade_response_headers<'a, 'b, H>(
    request_headers: H,
    version: Option<&'a str>,
    buf: &'b mut [u8; 33],
) -> Result<[(&'b str, &'b str); 4], UpgradeError>
where H: IntoIterator<Item = (&'a str, &'a str)>,
Expand description

Return ready-to-use WS upgrade response headers

Parameters:

  • request_headers: The request headers
  • version: The Sec-WebSocket-Version header, if present; otherwise version “13” is assumed
  • buf: A buffer to use for base64 encoding bits and pieces of the response