Add User-Agent header into command downloading plugins
This commit is contained in:
committed by
Oluwaseun Olorunsola
parent
0eeb74b58c
commit
f45ecefc22
@ -29,7 +29,10 @@ class WPOrgPluginDownloader {
|
||||
mkdir($downloadDir, 0777, true);
|
||||
}
|
||||
|
||||
$this->httpClient->get($downloadLink, ['sink' => $downloadDir . $zip, 'headers' => ['Accept' => 'application/octet-stream']]);
|
||||
$this->httpClient->get($downloadLink, ['sink' => $downloadDir . $zip, 'headers' => [
|
||||
'Accept' => 'application/octet-stream',
|
||||
'User-Agent' => 'MailPoet', // using user-agent to avoid 403 error
|
||||
]]);
|
||||
file_put_contents($downloadDir . '/' . $zip . '-info', $downloadLink);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user