microsoft / php-sdk-binary-tools

Tool kit for building PHP under Windows
BSD 2-Clause "Simplified" License
270 stars 79 forks source link

Empty user agent causes fetcher to fail #35

Closed uuf6429 closed 6 years ago

uuf6429 commented 6 years ago

The fetcher returns the following data from the server:

20/feb/2018: Hi! We seem to be receiving high volume requests coming from empty user agents. While this shouldn't be an issue, this unfortunately resulted in bandwidth issues on this server causing all downloads to be unavailable. We've therefore decided to temporarily block empty user agents until we upgraded our server bandwidth.

03/mar/2018: We've upgraded the server bandwidth. This is however still not sufficient to handle all empty user agent connections. Please update the user agent in your scripts accordingly or contact us so we can discuss it.

Thank you for your understanding.

The fix is to add the following in FileOps::download():

curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT) Curl');
weltling commented 6 years ago

Thanks for the report. Which SDK version do you use? Be sure you use the latest one.

Thanks.

uuf6429 commented 6 years ago

You're right... I used a slightly older version to see if I could get around some issues I was having. This problem has been solved.