MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / into_response

Method into_response

crates/client-api/src/util/websocket.rs:120–137  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

118
119impl IntoResponse for WebSocketUpgradeRejection {
120 fn into_response(self) -> Response {
121 match self {
122 Self::MethodNotGet => (StatusCode::METHOD_NOT_ALLOWED, "Request method must be `GET`").into_response(),
123 Self::BadUpgrade => (
124 StatusCode::UPGRADE_REQUIRED,
125 TypedHeader(Connection::upgrade()),
126 TypedHeader(Upgrade::websocket()),
127 "This service requires use of the websocket protocol",
128 )
129 .into_response(),
130 Self::BadVersion => (
131 StatusCode::BAD_REQUEST,
132 "`Sec-WebSocket-Version` header did not include '13'",
133 )
134 .into_response(),
135 Self::KeyMissing => (StatusCode::BAD_REQUEST, "`Sec-WebSocket-Key` header missing").into_response(),
136 }
137 }
138}
139
140impl WebSocketUpgrade {

Callers 8

handle_post_heap_enabledFunction · 0.45
callFunction · 0.45
handle_http_route_implFunction · 0.45
schemaFunction · 0.45
get_timestampFunction · 0.45
select_protocolMethod · 0.45
ignore_protocolMethod · 0.45

Calls 2

PendingWebSocketClass · 0.85
mapMethod · 0.45

Tested by

no test coverage detected