Skip to content

Commit 46ead64

Browse files
authored
Add UA to curl request
Occasionally the requests to wp.org get rate limited. After a discussion with the systems team, it was determined that the requests are being sent with a user agent, and are more likely to be blocked without one - this commit adds one.
1 parent 33f5414 commit 46ead64

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

functions.php

+1
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ function upload_results( $results, $rev, $message, $env, $api_key ) {
242242
curl_setopt( $process, CURLOPT_TIMEOUT, 30 );
243243
curl_setopt( $process, CURLOPT_POST, 1 );
244244
curl_setopt( $process, CURLOPT_CUSTOMREQUEST, 'POST' );
245+
curl_setopt( $process, CURLOPT_USERAGENT, 'WordPress PHPUnit Test Runner' );
245246
curl_setopt( $process, CURLOPT_POSTFIELDS, $data_string );
246247
curl_setopt( $process, CURLOPT_RETURNTRANSFER, true );
247248
curl_setopt( $process, CURLOPT_HTTPHEADER, array(

0 commit comments

Comments
 (0)