From 4d412748070e28826ae5f119ed2585eab45e6375 Mon Sep 17 00:00:00 2001 From: Andy Leiserson Date: Fri, 20 Dec 2024 12:08:53 -0800 Subject: [PATCH] Fix input_from_url test --- ipa-core/src/net/error.rs | 2 +- ipa-core/src/net/query_input.rs | 2 +- ipa-core/src/net/server/handlers/query/input.rs | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/ipa-core/src/net/error.rs b/ipa-core/src/net/error.rs index 82426b402..f137c3232 100644 --- a/ipa-core/src/net/error.rs +++ b/ipa-core/src/net/error.rs @@ -54,7 +54,7 @@ pub enum Error { status: hyper::StatusCode, reason: String, }, - #[error("Failed to connect to {dest}: {inner}")] + #[error("Failed to connect to {dest}: {inner:?}")] ConnectError { dest: String, #[source] diff --git a/ipa-core/src/net/query_input.rs b/ipa-core/src/net/query_input.rs index f2608392f..7a71b6f77 100644 --- a/ipa-core/src/net/query_input.rs +++ b/ipa-core/src/net/query_input.rs @@ -26,7 +26,7 @@ pub async fn stream_query_input_from_url(uri: &Uri) -> Result HttpsConnectorBuilder::default() .with_native_roots() .expect("System truststore is required") - .https_only() + .https_or_http() .enable_all_versions() .build(), ); diff --git a/ipa-core/src/net/server/handlers/query/input.rs b/ipa-core/src/net/server/handlers/query/input.rs index 1de6ea570..fa97b124b 100644 --- a/ipa-core/src/net/server/handlers/query/input.rs +++ b/ipa-core/src/net/server/handlers/query/input.rs @@ -98,7 +98,7 @@ mod tests { #[tokio::test(flavor = "multi_thread")] async fn input_from_url() { const QUERY_ID: QueryId = QueryId; - const DATA: &str = "input records"; + const DATA: &str = ""; let server = tiny_http::Server::http("localhost:0").unwrap(); let addr = server.server_addr(); @@ -124,9 +124,8 @@ mod tests { .await; let url = format!( - "http://localhost:{}{}/{QUERY_ID}/input", + "http://localhost:{}/input-data", addr.to_ip().unwrap().port(), - http_serde::query::BASE_AXUM_PATH, ); let req = http_serde::query::input::Request::new(QueryInput::FromUrl { query_id: QUERY_ID,