[webkit-changes] [WebKit/WebKit] 775f73: [webkitcorepy] Add a PartialProxy class
Jonathan Bedard
noreply at github.com
Mon Feb 27 15:49:39 PST 2023
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 775f730ac67edfb60a140d4550965b89b6205547
https://github.com/WebKit/WebKit/commit/775f730ac67edfb60a140d4550965b89b6205547
Author: Jonathan Bedard <jbedard at apple.com>
Date: 2023-02-27 (Mon, 27 Feb 2023)
Changed paths:
M Tools/Scripts/libraries/webkitcorepy/setup.py
M Tools/Scripts/libraries/webkitcorepy/webkitcorepy/__init__.py
A Tools/Scripts/libraries/webkitcorepy/webkitcorepy/partial_proxy.py
A Tools/Scripts/libraries/webkitcorepy/webkitcorepy/tests/partial_proxy_unittest.py
Log Message:
-----------
[webkitcorepy] Add a PartialProxy class
https://bugs.webkit.org/show_bug.cgi?id=253007
rdar://105984609
Rubber-stamped by Aakash Jain.
Allow Python programs to send requests to specific hosts through a proxy, but not requests
to all hosts.
* Tools/Scripts/libraries/webkitcorepy/setup.py: Bump version.
* Tools/Scripts/libraries/webkitcorepy/webkitcorepy/__init__.py: Ditto.
* Tools/Scripts/libraries/webkitcorepy/webkitcorepy/__init__.py: Export PartialProxy class.
* Tools/Scripts/libraries/webkitcorepy/webkitcorepy/partial_proxy.py: Added.
(PartialProxy.__init__): Store the hosts and http and https proxies.
(PartialProxy.__enter__): Mock all request calls to use a temporary Session object.
(PartialProxy.__enter__.Session): Add proxy arguments to requests to the specified hosts.
(PartialProxy.__exit__):
* Tools/Scripts/libraries/webkitcorepy/webkitcorepy/tests/partial_proxy_unittest.py: Added.
(DummySession): Session object which simply stores the passed proxy arguments.
(PartialProxyTest.test_session):
Canonical link: https://commits.webkit.org/260909@main
More information about the webkit-changes
mailing list