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',
};
Description
customHeaderspassed to theAirtableconstructor (or via options) are not applied to the vast majority of requests made by the library.Root cause
Base.makeRequest()correctly mergesthis._airtable._customHeadersvia_getRequestHeaders().table.select(),.create(),.update(),.replace(),.destroy(),.find(), and the corresponding methods onRecord) go through the olderrunActionpath (src/run_action.ts).run_action.tshardcodes the headers and never reads_customHeaders: