algolia / algoliasearch-client-kotlin

⚡️ A fully-featured and blazing-fast Kotlin/Android API client to interact with Algolia.
https://www.algolia.com/doc/api-client/getting-started/install/kotlin/
MIT License
59 stars 23 forks source link

Error 431 Request Header Fields Too Large with some API Keys #414

Open jwells89 opened 8 months ago

jwells89 commented 8 months ago

Describe the bug 🐛 For some users with a large number of permissions (increasing length of the API key), search fails with 431 Request Header Fields Too Large.

To Reproduce 🔍 Steps to reproduce the behavior:

  1. Set up a typical search client through instantsearch-android or other user of algoliasearch-client-kotlin
  2. Do a search with a long API key
  3. Observe described error

Expected behavior 💭 API key is sent in request body instead, producing no error and successfully searching.

Environment:

Additional context Some of our users have complicated, highly individual permissions which results in unavoidably long API keys. In the past, we encountered a similar issue in the iOS version of our app, which had the described fix applied and merged.

The now-archived algoliasearch-client-android which we had been using in our app previously behaved this way, but this was not carried over to algoliasearch-client-kotlin.