Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update HeaderSelector when configuration changes #538

Merged
merged 1 commit into from
May 5, 2023

Conversation

chrisribal
Copy link
Contributor

I've been using the multi version of the laravel library. Whenever a seller region was not NA, I got a "403 forbidden". Tracking it down, I noticed, that the laravel lib initially loads the "HeaderSelector" with the default config.

When you call an APIs (or BaseAPIs) setConfig method, the new configuration applies, including the new region. But, as the HeaderSelector still references the 'old' config with region NA, a wrong 'Host' header will be set. Therefore the request signing process is wrong and ends in a 403, whenever the region is not NA.

Set a new HeaderSelector instance with updated configuration
@jlevers
Copy link
Owner

jlevers commented May 5, 2023

Thanks for the catch! I never tested the Laravel library with a non-NA endpoint...whoops.

@jlevers jlevers merged commit 5991a52 into jlevers:main May 5, 2023
@chrisribal chrisribal deleted the patch-1 branch May 5, 2023 19:21
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.

2 participants