From 284880d096d1a4e4f746cc49de945f3186207285 Mon Sep 17 00:00:00 2001 From: arkon Date: Wed, 15 Jun 2022 18:05:56 -0400 Subject: [PATCH] Fix WebView user-agent (fixes #7306) The `source.headers.toMultimap()` call in WebViewActivity makes all the names lowercase. --- .../main/java/eu/kanade/presentation/webview/WebViewScreen.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/kanade/presentation/webview/WebViewScreen.kt b/app/src/main/java/eu/kanade/presentation/webview/WebViewScreen.kt index f59568e2a..94b0ed0f3 100644 --- a/app/src/main/java/eu/kanade/presentation/webview/WebViewScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/webview/WebViewScreen.kt @@ -44,7 +44,7 @@ fun WebViewScreen( onClearCookies: (String) -> Unit, ) { val context = LocalContext.current - val state = rememberWebViewState(url = url) + val state = rememberWebViewState(url = url, additionalHttpHeaders = headers) val navigator = rememberWebViewNavigator() Column { @@ -144,7 +144,7 @@ fun WebViewScreen( WebView.setWebContentsDebuggingEnabled(true) } - headers["User-Agent"]?.let { + headers["user-agent"]?.let { webView.settings.userAgentString = it } },