diff --git a/query-engine/connector-test-kit-rs/query-tests-setup/src/runner/mod.rs b/query-engine/connector-test-kit-rs/query-tests-setup/src/runner/mod.rs index 0627e5076773..8c4ed028399e 100644 --- a/query-engine/connector-test-kit-rs/query-tests-setup/src/runner/mod.rs +++ b/query-engine/connector-test-kit-rs/query-tests-setup/src/runner/mod.rs @@ -2,6 +2,8 @@ mod binary; mod direct; mod node_api; +use std::collections::HashMap; + pub use binary::*; pub use direct::*; use hyper::HeaderMap; @@ -163,16 +165,27 @@ impl Runner { } } - pub fn set_headers(&mut self, headers: Option) { + pub fn set_headers(&mut self, headers: HashMap) { match &mut self.inner { RunnerType::Direct(_) => todo!(), RunnerType::NodeApi(_) => todo!(), - RunnerType::Binary(r) => r.set_additional_headers(headers), + RunnerType::Binary(r) => { + let map = Some(HeaderMap::from_iter( + headers + .into_iter() + .map(|(k, v)| (k.parse().unwrap(), v.parse().unwrap())), + )); + r.set_additional_headers(map) + } } } pub fn clear_headers(&mut self) { - self.set_headers(None) + match &mut self.inner { + RunnerType::Direct(_) => todo!(), + RunnerType::NodeApi(_) => todo!(), + RunnerType::Binary(r) => r.set_additional_headers(None), + } } async fn direct(datamodel: String, connector_tag: ConnectorTag, metrics: MetricRegistry) -> TestResult { diff --git a/query-engine/query-engine/src/server/mod.rs b/query-engine/query-engine/src/server/mod.rs index a939f8d9bf72..3f5c6e9b1321 100644 --- a/query-engine/query-engine/src/server/mod.rs +++ b/query-engine/query-engine/src/server/mod.rs @@ -143,6 +143,7 @@ async fn graphql_handler(state: State, req: Request) -> Result