diff options
| author | mo khan <mo@mokhan.ca> | 2025-07-04 12:46:24 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-07-04 12:46:24 -0600 |
| commit | 093c2a626b41f920e6c9fa8efbc6e497761cba10 (patch) | |
| tree | 5187f7fffb7daa6ab57ccbc7e12e4407cece4a9b /tests | |
| parent | f8549af8d64b551449957c3004b74ed0bf69c593 (diff) | |
feat: allow access to sparkle homepage
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/authorization/check_service_test.rs | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/tests/authorization/check_service_test.rs b/tests/authorization/check_service_test.rs index 3f8adec2..0a2997cf 100644 --- a/tests/authorization/check_service_test.rs +++ b/tests/authorization/check_service_test.rs @@ -140,35 +140,29 @@ mod tests { // {status: tonic::Code::PermissionDenied, http: &HTTPRequest{Method: "GET", Path: "/dashboard", Headers: invalidHeaders}}, // {status: tonic::Code::PermissionDenied, http: &HTTPRequest{Method: "POST", Path: "/sparkles"}}, // - // http: Some(HttpRequest { - // id: \"13810813926834082307\", + // http: // method: \"GET\", // headers: { - // \"accept\": \"*/*\", // \":method\": \"GET\", - // \"accept-encoding\": \"gzip, deflate, br, zstd\", - // \"user-agent\": \"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36\", - // \"x-request-id\": \"b191fe87-e9b8-458e-b9ec-46d477a62803\", // \":authority\": \"localhost:10000\", // \":path\": \"/sparkles\", - // \"x-forwarded-proto\": \"http\", - // \":scheme\": \"http\", // }, - // header_map: None, // path: \"/sparkles\", // host: \"localhost:10000\", - // scheme: \"http\", - // query: \"\", - // fragment: \"\", - // size: 0, - // protocol: \"HTTP/1.1\", - // body: \"\", - // raw_body: [] let request = tonic::Request::new(build_request(|item: &mut HttpRequest| { let path = String::from("/"); + let method = String::from("GET"); + let host = String::from("sparkle.staging.runway.gitlab.net"); + + item.method = method.clone(); item.path = path.clone(); - item.headers = build_headers(vec![(String::from(":path"), path)]); + item.host = host.clone(); + item.headers = build_headers(vec![ + (String::from(":path"), path), + (String::from(":method"), method), + (String::from(":authority"), host), + ]); })); let response = subject().check(request).await; |
