()
| 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() { |
nothing calls this directly
no test coverage detected