tpyo / amazon-s3-php-class

A standalone Amazon S3 (REST) client for PHP 5/CURL
1.03k stars 504 forks source link

Easy fix for getObjectInfo bug #158

Open rewb0rn opened 5 years ago

rewb0rn commented 5 years ago

Hi,

we found that getObjectInfo() is not checking for 403 error code, which can be returned instead of 404 when a file does not exist. This produces error logs although it is expected behavior. The fix is easy, please change this

if ($rest->error === false && ($rest->code !== 200 && $rest->code !== 404))

to this:

if ($rest->error === false && ($rest->code !== 200 && $rest->code !== 403 && $rest->code !== 404))

in getObjectInfo() (line 866 in current version)