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

Function accepts_lan_cookie_for_browser_ui

packages/server/src/auth.rs:374–403  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

372
373 #[test]
374 fn accepts_lan_cookie_for_browser_ui() {
375 let config = Config::new(
376 4310,
377 PathBuf::from("packages/client/dist"),
378 IpAddr::V4(Ipv4Addr::UNSPECIFIED),
379 Some("10.0.0.245".to_owned()),
380 ServerKind::Standalone,
381 "auto".to_owned(),
382 false,
383 Some("secret-token".to_owned()),
384 Some("123456".to_owned()),
385 );
386 let mut headers = HeaderMap::new();
387 headers.insert(
388 header::COOKIE,
389 HeaderValue::from_static("simdeck_token=secret-token"),
390 );
391 headers.insert(
392 header::ORIGIN,
393 HeaderValue::from_static("http://10.0.0.245:4310"),
394 );
395
396 assert!(api_request_authorized(
397 &config,
398 &Method::POST,
399 &headers,
400 false,
401 None
402 ));
403 }
404
405 #[test]
406 fn accepts_cookie_for_same_origin_tailscale_host() {

Callers

nothing calls this directly

Calls 1

insertMethod · 0.80

Tested by

no test coverage detected