diff --git a/nodejs/__test__/remote.test.ts b/nodejs/__test__/remote.test.ts index eb62d9f5..7d389da9 100644 --- a/nodejs/__test__/remote.test.ts +++ b/nodejs/__test__/remote.test.ts @@ -108,7 +108,10 @@ describe("remote connection", () => { it("should pass on requested extra headers", async () => { await withMockDatabase( (req, res) => { - expect(req.headers["x-my-header"]).toEqual("my-value"); + expect(req.headers["foo"]).toEqual("1"); + expect(req.headers["bar"]).toEqual("2"); + expect(req.headers["baz"]).toEqual("3"); + expect(req.headers["x-log-attrs"]).toEqual("foo, bar, baz"); const body = JSON.stringify({ tables: [] }); res.writeHead(200, { "Content-Type": "application/json" }).end(body); @@ -119,9 +122,12 @@ describe("remote connection", () => { }, { clientConfig: { - extraHeaders: { - "x-my-header": "my-value", - }, + extraHeaders: { + "x-log-attrs": "foo, bar, baz", + foo: "1", + bar: "2", + baz: "3", + }, }, }, ); diff --git a/rust/lancedb/src/remote/client.rs b/rust/lancedb/src/remote/client.rs index 50bc52a6..6bb37548 100644 --- a/rust/lancedb/src/remote/client.rs +++ b/rust/lancedb/src/remote/client.rs @@ -2,7 +2,7 @@ // SPDX-FileCopyrightText: Copyright The LanceDB Authors use http::HeaderName; -use log::debug; +use log::{debug, info}; use reqwest::{ header::{HeaderMap, HeaderValue}, Body, Request, RequestBuilder, Response, @@ -324,6 +324,7 @@ impl RestfulLanceDbClient { } for (key, value) in &config.extra_headers { + info!("header: {}={}", key, value); let key_parsed = HeaderName::from_str(key).map_err(|_| Error::InvalidInput { message: format!("non-ascii value for header '{}' provided", key), })?;