Skip to content

customHeaders are ignored by the primary request path used by table/record methods #428

Description

@nouraellm

Description

customHeaders passed to the Airtable constructor (or via options) are not applied to the vast majority of requests made by the library.

Root cause

  • Base.makeRequest() correctly merges this._airtable._customHeaders via _getRequestHeaders().
  • Almost all high-level API methods (table.select(), .create(), .update(), .replace(), .destroy(), .find(), and the corresponding methods on Record) go through the older runAction path (src/run_action.ts).
  • run_action.ts hardcodes the headers and never reads _customHeaders:
const headers = {
    authorization: `Bearer ${base._airtable._apiKey}`,
    'x-api-version': base._airtable._apiVersion,
    'x-airtable-application-id': base.getId(),
    'content-type': 'application/json',
};

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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