MCPcopy Create free account
hub / github.com/Dstack-TEE/dstack / rejects_no_prefix

Function rejects_no_prefix

gateway/src/pp.rs:239–247  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

237
238 #[tokio::test]
239 async fn rejects_no_prefix() {
240 // Looks neither like v1 ("PROXY") nor v2 magic.
241 let bytes = b"GET / HTTP/1.1\r\nHost: example.com\r\n\r\n";
242 let err = read_proxy_header(&bytes[..]).await.unwrap_err();
243 assert!(
244 format!("{err:#}").contains("no valid proxy protocol header"),
245 "unexpected error: {err:#}"
246 );
247 }
248
249 #[tokio::test]
250 async fn rejects_v1_without_terminator() {

Callers

nothing calls this directly

Calls 1

read_proxy_headerFunction · 0.85

Tested by

no test coverage detected