MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / websocket_path_with_access_token

Function websocket_path_with_access_token

packages/server/src/devtools.rs:897–909  ·  view source on GitHub ↗
(path: String, access_token: Option<&str>)

Source from the content-addressed store, hash-verified

895}
896
897fn websocket_path_with_access_token(path: String, access_token: Option<&str>) -> String {
898 let Some(access_token) = access_token
899 .map(str::trim)
900 .filter(|access_token| !access_token.is_empty())
901 else {
902 return path;
903 };
904 let separator = if path.contains('?') { '&' } else { '?' };
905 format!(
906 "{path}{separator}simdeckToken={}",
907 percent_encode_query_component(access_token)
908 )
909}
910
911/// Reverse-proxies a Metro HTTP path over the SimDeck origin. The upstream
912/// request omits the browser `Origin` so Metro's dev-middleware does not reject

Callers 1

build_metro_targetFunction · 0.85

Calls 1

is_emptyMethod · 0.80

Tested by

no test coverage detected