Skip to main content

validate_server_setup

Function validate_server_setup 

Source
pub fn validate_server_setup(msg: &ServerSetup) -> Result<(), SetupError>
Expand description

Validate a SERVER_SETUP message.

Section 6.2.2.2 on PATH: “It MUST NOT be used by the server, or when WebTransport is used. If the peer receives a PATH parameter from the server, or when WebTransport is used, it MUST close the connection.” Nothing else in a SERVER_SETUP is restricted by sender.

ROLE is required of the server too, by the same sentence in Section 6.2.2.1 that requires it of the client.

§Errors

SetupError::WrongParameterRole if the server sent a PATH.

SetupError::MissingParameter if no ROLE is present, and SetupError::InvalidRole if its value is not one the draft assigns.