jenkins-bot has submitted this change. (
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1338048?usp=email )
Change subject: http: Avoid copying extra headers before merging
......................................................................
http: Avoid copying extra headers before merging
Update request headers directly from the configured extra headers.
The update leaves the source mapping unchanged, so an intermediate
copy and empty-dictionary fallback are unnecessary.
Change-Id: Ia2ee2e95bbd6e91662be3dbcb2029b8663d59e7e
---
M pywikibot/comms/http.py
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/comms/http.py b/pywikibot/comms/http.py
index a410d7a..7dea9a5 100644
--- a/pywikibot/comms/http.py
+++ b/pywikibot/comms/http.py
@@ -457,7 +457,7 @@
# Change user agent depending on fake UA settings.
# Set header to new UA if needed.
headers = headers or {}
- headers.update(config.extra_headers.copy() or {})
+ headers.update(config.extra_headers)
def assign_fake_user_agent(use_fake_user_agent, uri):
uri_domain = urlparse(uri).netloc
--
To view, visit
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1338048?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: Ia2ee2e95bbd6e91662be3dbcb2029b8663d59e7e
Gerrit-Change-Number: 1338048
Gerrit-PatchSet: 2
Gerrit-Owner: Mahveotm <[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]