#37708 closed defect (bug) (fixed)
`wp_http_supports()` doesn't reflect what Requests can do
Reported by: | dd32 | Owned by: | peterwilsoncc |
---|---|---|---|
Milestone: | 6.7 | Priority: | normal |
Severity: | normal | Version: | 4.6 |
Component: | HTTP API | Keywords: | has-patch |
Focuses: | Cc: |
Description
While reviewing what parts of WP_HTTP
can be removed in #37705, I noticed that wp_http_supports()
still performs it's checks against the WP_HTTP
transports rather than querying against Requests to see if the request can be performed or not.
The only capability which we supported was ssl
.
Three options:
- Query SSL ability against Requests (if it supports that)
- Deprecate and always
return true;
- Implement a small check to see if SSL requests will be able to proceed, checking for cURL features or openssl being available (and all the other streams requirements being satisfied).
The above options are in my order of preferences, we should support it if possible, but I'm not afraid of just no-oping the function.
Marking for 4.7, with the potential for 4.6.x backporting.
Change History (22)
#2
@
8 years ago
I couldn't see anything in Requests that we could use, but I also feel that adding a method for checking to see if we can *maybe* support SSL wouldn't be out of the question..
This ticket was mentioned in Slack in #core by desrosj. View the logs.
8 years ago
This ticket was mentioned in Slack in #core by jeffpaul. View the logs.
8 years ago
This ticket was mentioned in Slack in #core by jeffpaul. View the logs.
8 years ago
#7
@
8 years ago
Opened https://github.com/rmccue/Requests/issues/250 upstream.
This ticket was mentioned in Slack in #core by jeffpaul. View the logs.
8 years ago
This ticket was mentioned in Slack in #core by helen. View the logs.
8 years ago
#10
@
8 years ago
- Keywords early added
- Milestone changed from 4.7 to Future Release
Punting, it was broken in 4.6, mostly works still as long as the majority of the WP_HTTP logic remains in sync with Requests (which it is at present).
#11
@
5 years ago
- Keywords needs-patch removed
- Milestone Future Release deleted
- Resolution set to reported-upstream
- Status changed from new to closed
I’m going to close this out as reported upstream. When Requests is updated and the PR above is merged, this will make its way in.
#12
@
3 years ago
- Milestone set to 6.0
- Resolution reported-upstream deleted
- Status changed from closed to reopened
Requests 2.0.0 has been released and includes the change needed to address this.
The update to Requests 2.0.0 is expected to still go into WP 5.9. Once the upgrade patch has been merged, we should be able to address this ticket with relative ease.
Related: #54504
This ticket was mentioned in Slack in #core by chaion07. View the logs.
2 years ago
#15
@
2 years ago
Per discussion in a recent bug scrub, I am moving this off the 6.0 milestone as it depends on Requests 2.0.0 being merged.
Props @costdev, @chaion07.
This ticket was mentioned in Slack in #core by costdev. View the logs.
2 years ago
This ticket was mentioned in PR #6771 on WordPress/wordpress-develop by @dd32.
3 months ago
#18
- Keywords has-patch added
This ceases using the Deprecated WP_HTTP::_get_first_available_transport() method and calls Requests directly.
Trac ticket: https://core.trac.wordpress.org/ticket/37708
#19
@
3 months ago
8 years later, this is causing some issues with WordPress playground, which uses a custom fetch transport.
https://github.com/WordPress/wordpress-playground/issues/1494
After doing some digging with the aid of wpdirectory.net I've been unable to find any instances of wp_http_supports() usage which looking for a capability other than ssl
, which is good, because we (WP_HTTP & Requests) don't support anything else here :)
The only instance I could find that was not looking for SSL was code similar to this:
if ( wp_http_supports( array(), 'http://www.example.com/' ) ) { ... }
The attached PR implements option 1 from the ticket, using the Requests v2 method.
#20
@
6 weeks ago
- Milestone changed from Future Release to 6.7
Moving this on to the 6.7 milestone for consideration.
I've approved the linked pull request. @jrf, if you have bandwidth it would be great if you could take a quick look at it too.
I like the first option, though a quick look through Requests makes me think it doesn't have that functionality. @rmccue - Does that sound correct?