From 72f5fe540c4bf8b7afd1289f69f0d0a93855510a Mon Sep 17 00:00:00 2001 From: Claude Brisson Date: Sat, 29 Nov 2025 11:10:33 +0100 Subject: [PATCH] Revert "Fix ratings fetch: remove brotli Accept-Encoding header" This reverts commit 935f53cf65e5bad326a1950dd73f1bf43d0d298d. --- .../kotlin/org/jeudego/pairgoth/ratings/RatingsHandler.kt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/view-webapp/src/main/kotlin/org/jeudego/pairgoth/ratings/RatingsHandler.kt b/view-webapp/src/main/kotlin/org/jeudego/pairgoth/ratings/RatingsHandler.kt index b45dc7f..803574d 100644 --- a/view-webapp/src/main/kotlin/org/jeudego/pairgoth/ratings/RatingsHandler.kt +++ b/view-webapp/src/main/kotlin/org/jeudego/pairgoth/ratings/RatingsHandler.kt @@ -107,11 +107,15 @@ abstract class RatingsHandler(val origin: RatingsManager.Ratings) { val request = Request.Builder() .url(url) .header("User-Agent", USER_AGENT) - .header("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8") + .header("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8") .header("Accept-Language", "en-US,en;q=0.9") - // Let OkHttp handle compression (it supports gzip/deflate but not brotli) + .header("Accept-Encoding", "gzip, deflate, br") .header("Connection", "keep-alive") .header("Upgrade-Insecure-Requests", "1") + .header("Sec-Fetch-Dest", "document") + .header("Sec-Fetch-Mode", "navigate") + .header("Sec-Fetch-Site", "none") + .header("Sec-Fetch-User", "?1") .build() client.newCall(request).execute().use { response ->