LibWebView: Respect autocomplete response Content-Encoding headers

For example, Google uses ISO-8859-1 encoding. This patch allows us to
decode such responses, falling back to UTF-8 if a Content-Type was not
specified or could not be parsed. We should also now handle if decoding
fails, rather than crashing inside JsonParser.
This commit is contained in:
Timothy Flynn 2025-04-16 17:35:24 -04:00 committed by Tim Flynn
commit 5e9a11b13d
Notes: github-actions[bot] 2025-04-17 11:52:41 +00:00
3 changed files with 29 additions and 6 deletions

View file

@ -34,7 +34,7 @@ public:
void query_autocomplete_engine(String);
private:
static ErrorOr<Vector<String>> received_autocomplete_respsonse(AutocompleteEngine const&, StringView response);
static ErrorOr<Vector<String>> received_autocomplete_respsonse(AutocompleteEngine const&, Optional<ByteString const&> content_type, StringView response);
void invoke_autocomplete_query_complete(Vector<String> suggestions) const;
String m_query;