MCPcopy Index your code
hub / github.com/NativeScript/SimDeck / unauthorized_response

Function unauthorized_response

packages/server/src/auth.rs:103–120  ·  view source on GitHub ↗
(config: &Config, headers: &HeaderMap)

Source from the content-addressed store, hash-verified

101}
102
103pub fn unauthorized_response(config: &Config, headers: &HeaderMap) -> Response {
104 let mut response = (
105 StatusCode::UNAUTHORIZED,
106 Json(json!({
107 "error": "SimDeck API access token is required.",
108 "ok": false,
109 "serverId": server_identity(config),
110 "advertiseHost": config.advertise_host,
111 "hostId": config.host_id,
112 "hostName": config.host_name,
113 "httpPort": config.http_port,
114 "serverKind": config.server_kind.as_str(),
115 })),
116 )
117 .into_response();
118 append_cors_headers(config, headers, response.headers_mut());
119 response
120}
121
122pub fn append_cors_headers(
123 config: &Config,

Callers 2

require_api_authFunction · 0.85
pair_browserFunction · 0.85

Calls 2

append_cors_headersFunction · 0.85
into_responseMethod · 0.80

Tested by

no test coverage detected