-
-
Notifications
You must be signed in to change notification settings - Fork 462
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
Customizing HTTP arguments for all requests #783
Comments
Can you give me an example of this? |
I use $args = [
'timeout' => 180,
'user-agent' => 'my-plugin-name/WP-CLI',
'sslverify' => false,
];
$response = wp_remote_post( $url, $args ); When GitHub Updater is network activated, request arguments look like this:
Your plugin appends changes using |
I was asked several years ago by someone at GitHub to add a header specifically identifying GHU. Just as I use the |
That's understandable, but it affects whole WordPress installation.
I'm aware I can remove it, but it's not a perfect solution to have to think about removing hooks for every plugin which uses |
GitHub GET requests are on HTTPS. If your plugin makes different requests you can filter based upon the URL as it is passed in the filter. I’m on mobile today. But I’ll look to see if I don’t/can’t remove this filter after it’s used. |
@pawelkmpt can you test and confirm this fix? Thanks. |
@afragen yes, it's fine now. Thank you! |
I wanted to ask why this plugin appends HTTP arguments for all requests (or at least requests in custom WP-CLI commands)? It'd be better to add it only when GitHub Updater actions are performed.
Current behavior breaks my plugin in which I need custom user agent and skip SSL verification.
The text was updated successfully, but these errors were encountered: