diff --git a/src/lib.rs b/src/lib.rs index b81f7c4..4a6cadb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -693,12 +693,15 @@ impl Client { let mut headers = Self::default_http_headers(); for (key, value) in additional_headers { - headers.insert(key.unwrap(), value); + match key { + None => return Err(Error::InvalidResponse), + Some(k) => headers.insert(k, value), + }; } let http_client = Arc::new( HttpClientBuilder::default() .set_headers(headers) - .build(&base_url)?, + .build(base_url)?, ); client.http_client = http_client;