algolia / algoliasearch-helper-flutter

⚑️ Building block to create instant-search applications with Flutter
https://www.algolia.com/doc/guides/building-search-ui/what-is-instantsearch/flutter/
Other
22 stars 15 forks source link

Unsafe header Issue with HitsSearcher #55

Closed ranvirsahota closed 10 months ago

ranvirsahota commented 1 year ago

Describe the bug πŸ›
Every time I execute a search I get an error in the chrome dev console. Only on chrome, nothing noted on Firefox. The code I use to execute a search is below. To Reproduce πŸ”
The first time the page loads I this runs, I am also using the bloc architecture. I get this issue whether I use HitsSearcher then use applyState or the factory method like below.

      final _searcher = HitsSearcher.create(
        applicationID: ALGOLIA_APPLICATION_ID,
        apiKey: ALGOLIA_INVOICES_INDEX_KEY,
        state: SearchState(
          indexName: ALGOLIA_INVOICES_INDEX_NAME,
          page: page,
          hitsPerPage: 10,
        ),
      );

Deploy it to Chrome

Expected behavior πŸ’­
In the web browser Console

Refused to set unsafe header "User-Agent"

Screenshots πŸ–₯

Environment:

Additional context
Add any other context about the problem here.

VladislavFitz commented 10 months ago

Beginning with version 0.4.0, our library has integrated the official Dart API client, which employs the x-algolia-agent. This update has resolved the issue in question.