Error 494 Header Too Large with some API Keys
jwells89 opened this issue Β· comments
Describe the bug π
For some users with a large number of permissions (increasing length of the API key), search fails with 494 Header too large
.
To Reproduce π
Steps to reproduce the behavior:
- Set up a
SearchClient
(orSearchClient
user from instantsearch-ios) with app ID and API key for user with large number of permissions sent down from back end - Attempt a search
- See error
Expected behavior π
API key is sent in request body instead, producing no error and successfully searching.
Environment:
- OS: iOS 15.1
- Version: instantsearch-ios 7.14.0/algoliasearch-client-swift 8.12.0
Additional context
This appears to have been fixed in the past by conditionally sending the API key in the body of the request instead of the header when maximum key length is exceeded in issue #509, but it appears that this behavior was not re-implemented in a refactor/rewrite that happened at some point since then.
Hi @jwells89,
Thank you for reporting this!
The patch will be released soon.
Thanks a bunch @VladislavFitz!
Anything we can do to help?
Hi @jwells89 , @aleemstreak ,
I have just the PR with a fix.
Could you test it confirm if it works for you? Thanks.
Hi @VladislavFitz,
This fix works great in my testing. Thanks!