wordpress-playground
wordpress-playground copied to clipboard
Filter Requests library to use the Fetch handler.
What is this PR doing?
As the 'http_api_transports' filter is deprecated and no longer actively used, this filters the Requests library to always use the Fetch transport.
What problem is it solving?
When the kitchen sink is enabled (ie. streams extension) Requests is using that for HTTP requests, rather than using the Fetch transport (and does not automatically fallback to it).
How is the problem addressed?
Filters the Requests internals to always use the transport.
Testing Instructions
- Load with kitchen sink
- Observe failing requests, and no attempt to use Fetch
- Apply Patch
- Load with kitchen sink
- Observe requests succeed (or fail with CORS issues via fetch).
Fixes #1047
Surfacing this comment: https://github.com/WordPress/wordpress-playground/issues/1047#issuecomment-1993909379
I rebased and adjusted this PR, we should stop seeing the console warnings about the http_api_transports
filter in wp-admin.