-
Notifications
You must be signed in to change notification settings - Fork 498
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Requests::has_capability()
which can be used to determine if SSL is available.
#251
Conversation
…L is available. An example of it's usage: `Requests::has_capability( array( 'ssl' => true ) );`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems good to me; needs master merging in after we fix the tests in any case.
Adding a test for this method would be good too.
library/Requests.php
Outdated
public static function has_capability($capabilities = array()) { | ||
try { | ||
$transport = self::get_transport($capabilities); | ||
} catch(Requests_Exception $e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs a space after catch
Codecov Report
@@ Coverage Diff @@
## master #251 +/- ##
=========================================
- Coverage 92.11% 91.9% -0.21%
=========================================
Files 21 21
Lines 1762 1767 +5
=========================================
+ Hits 1623 1624 +1
- Misses 139 143 +4
Continue to review full report at Codecov.
|
This PR was closed inadvertently when we changed the stable branch from |
Recreated as #492 |
PR #492 has now been merged, so this will be included in the 2.0.0 release. |
Add
Requests::has_capability()
which can be used to determine if SSL is available.An example of it's usage:
Requests::has_capability( array( 'ssl' => true ) );
See #250