| 2077 | |
| 2078 | #[tokio::test] |
| 2079 | async fn p2_cli_serve_authority_and_scheme() -> Result<()> { |
| 2080 | let server = WasmtimeServe::new(P2_CLI_SERVE_AUTHORITY_AND_SCHEME_COMPONENT, |cmd| { |
| 2081 | cmd.arg("-Scli"); |
| 2082 | })?; |
| 2083 | |
| 2084 | let resp = server |
| 2085 | .send_request( |
| 2086 | hyper::Request::builder() |
| 2087 | .uri("/") |
| 2088 | .header("Host", "localhost") |
| 2089 | .body(String::new()) |
| 2090 | .context("failed to make request")?, |
| 2091 | ) |
| 2092 | .await?; |
| 2093 | assert!(resp.status().is_success()); |
| 2094 | |
| 2095 | let resp = server |
| 2096 | .send_request( |
| 2097 | hyper::Request::builder() |
| 2098 | .method("CONNECT") |
| 2099 | .uri("http://localhost/") |
| 2100 | .body(String::new()) |
| 2101 | .context("failed to make request")?, |
| 2102 | ) |
| 2103 | .await?; |
| 2104 | assert!(resp.status().is_success()); |
| 2105 | |
| 2106 | Ok(()) |
| 2107 | } |
| 2108 | |
| 2109 | #[test] |
| 2110 | fn p2_cli_argv0() -> Result<()> { |