Skip to content

Fix customHeaders being ignored by the primary runAction request path - #429

Open
nouraellm wants to merge 1 commit into
Airtable:masterfrom
nouraellm:nouraellm-patch-1
Open

Fix customHeaders being ignored by the primary runAction request path#429
nouraellm wants to merge 1 commit into
Airtable:masterfrom
nouraellm:nouraellm-patch-1

Conversation

@nouraellm

Copy link
Copy Markdown

Summary

customHeaders passed to the Airtable constructor were only applied when using the lower-level base.makeRequest() method. All high-level table/record methods (select, create, update, replace, destroy, find, etc.) go through the older runAction path, which hard-coded headers and completely ignored _customHeaders.

This PR fixes that by making run_action.ts use the existing _getRequestHeaders() helper (the same one makeRequest already uses).

Changes

  • Updated src/run_action.ts to call base._getRequestHeaders() instead of hardcoding headers
  • Preserved the two extra headers (x-api-version and x-airtable-application-id) that the old path was sending
  • Removed now-unused packageVersion import and userAgent constant
  • Custom headers are now correctly applied on every request made by the library

Related issue

Fixes #428

## Summary

customHeaders passed to the Airtable constructor were only applied when using the lower-level base.makeRequest() method. All high-level table/record methods (select, create, update, replace, destroy, find, etc.) go through the older runAction path, which hard-coded headers and completely ignored _customHeaders.

This PR fixes that by making run_action.ts use the existing _getRequestHeaders() helper (the same one makeRequest already uses).

## Changes

- Updated src/run_action.ts to call base._getRequestHeaders() instead of hardcoding headers
- Preserved the two extra headers (x-api-version and x-airtable-application-id) that the old path was sending
- Removed now-unused packageVersion import and userAgent constant
- Custom headers are now correctly applied on every request made by the library

## Related issue

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant