Skip to content

Fix header forwarding in receiveMessagesPoll for localstack#4

Merged
fgiova merged 1 commit into
mainfrom
fix/sqs-poll
May 12, 2026
Merged

Fix header forwarding in receiveMessagesPoll for localstack#4
fgiova merged 1 commit into
mainfrom
fix/sqs-poll

Conversation

@fgiova
Copy link
Copy Markdown
Owner

@fgiova fgiova commented May 12, 2026

This pull request enhances the way API requests are made to the SQS backend by ensuring that configuration headers are consistently included. The main change is the use of a shared getConfigHeaders function to add custom headers to SQS API requests, improving maintainability and consistency.

API request improvements:

  • Updated receiveMessagesPoll in sqs.ts to include custom configuration headers in fetch requests by using the new getConfigHeaders function.
  • Changed the import in sqs.ts to bring in getConfigHeaders from api-client.ts.

Code sharing and export:

  • Changed getConfigHeaders in api-client.ts to be exported, making it available for use in other modules.

receiveMessagesPoll used a raw fetch without x-localstack-endpoint/x-localstack-region headers, so the backend fell back to the default region and returned 404 "Queue not found" for queues created in other regions. Export getConfigHeaders from api-client and apply it to the polling fetch.
@fgiova fgiova merged commit ac0b6e5 into main May 12, 2026
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 1.3.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant