Skip to content

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

@jwells89

Description

@jwells89

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:

  • OS: Android 14
  • Version: instantsearch-android 3.3.0/algoliasearch-client-kotlin 2.1.9

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions