create_unauthorized_response

Function create_unauthorized_response 

Source
pub fn create_unauthorized_response(realm: &str) -> Response<Full<Bytes>>
Expand description

Creates a 401 Unauthorized response with WWW-Authenticate header.

Used when Basic Authentication is enabled and the request is not authenticated or has invalid credentials.

§Arguments

  • realm - The authentication realm to display in the browser dialog

§Returns

An HTTP 401 response with WWW-Authenticate: Basic realm="..." header.