Skip to content

Extra-headers are not being passed in query() call #931

@bivas6

Description

@bivas6

Hi, thanks for this client package.

We are experiencing an issue with passing extra headers at the trinoClient.query({...}) stage. When we create the client with the extra headers, everything works as expected. However, the issue arises when we attempt to pass the extra headers in the query() call; something happens along the way, and this parameter is either ignored or overwritten.

Everything works:

const trinoClient = Trino.create({
  server: url,
  extraHeaders: {
    'X-extra-header': 'example-header-value'
  }
});
trinoClient.query({query: '...'});

Extra headers are ignored/overwritten:

const trinoClient = Trino.create({
  server: url
});
trinoClient.query({query: '...', extraHeaders: {'X-extra-header': 'example-header-value'}});

The extra header is dynamic value, so we can't use it once on the client creation; in addition we don't want to create a new client on every query. BTW, everything works as expected in the python client package.

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions