jenkins-bot has submitted this change. ( 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1239535?usp=email )

Change subject: weblinkchecker: use use preferred site encodings for 
Accept-Charset
......................................................................

weblinkchecker: use use preferred site encodings for Accept-Charset

Bug: T417142
Change-Id: Iea961ea093cd563816c5a46e4681e1ce2a7aebe4
---
M scripts/weblinkchecker.py
1 file changed, 3 insertions(+), 1 deletion(-)

Approvals:
  Xqt: Looks good to me, approved
  jenkins-bot: Verified




diff --git a/scripts/weblinkchecker.py b/scripts/weblinkchecker.py
index 5c35aed..b1ce723 100755
--- a/scripts/weblinkchecker.py
+++ b/scripts/weblinkchecker.py
@@ -249,11 +249,13 @@
         self.page = page
         self.url = url
         self.history = history
+        # use preferred site encodings
+        encodings = ','.join(self.page.site.encodings())
         self.header = {
             'Accept': 'text/xml,application/xml,application/xhtml+xml,'
                       'text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5',
             'Accept-Language': 'de-de,de;q=0.8,en-us;q=0.5,en;q=0.3',
-            'Accept-Charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.7',
+            'Accept-Charset': f'{encodings};q=0.8,*;q=0.7',
             'Keep-Alive': '30',
             'Connection': 'keep-alive',
         }

--
To view, visit 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1239535?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.wikimedia.org/r/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: Iea961ea093cd563816c5a46e4681e1ce2a7aebe4
Gerrit-Change-Number: 1239535
Gerrit-PatchSet: 3
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to