jenkins-bot has submitted this change and it was merged.
Change subject: Reimplement Http basic authentication
......................................................................
Reimplement Http basic authentication
Bug: T101494
Change-Id: I784bb1f8c893d02df6dfad5ae80942f6b1f944c9
---
M pywikibot/comms/http.py
1 file changed, 4 insertions(+), 3 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/comms/http.py b/pywikibot/comms/http.py
index a6ed6a8..6c35fe3 100644
--- a/pywikibot/comms/http.py
+++ b/pywikibot/comms/http.py
@@ -252,14 +252,15 @@
uri = http_request.uri
body = http_request.body
headers = http_request.headers
+ auth = config.authenticate.get(requests.utils.urlparse(uri).netloc, None)
timeout = config.socket_timeout
try:
- request = session.request(method, uri, data=body, headers=headers,
- verify=True, timeout=timeout)
+ response = session.request(method, uri, data=body, headers=headers,
+ auth=auth, timeout=timeout, verify=True)
except Exception as e:
http_request.data = e
else:
- http_request.data = request
+ http_request.data = response
def error_handling_callback(request):
--
To view, visit https://gerrit.wikimedia.org/r/220131
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I784bb1f8c893d02df6dfad5ae80942f6b1f944c9
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: VcamX <[email protected]>
Gerrit-Reviewer: Dragan Espenschied <[email protected]>
Gerrit-Reviewer: John Vandenberg <[email protected]>
Gerrit-Reviewer: Ladsgroup <[email protected]>
Gerrit-Reviewer: Merlijn van Deen <[email protected]>
Gerrit-Reviewer: Mjbmr <[email protected]>
Gerrit-Reviewer: XZise <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
Pywikibot-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-commits