I don't know AWS response; but generally speaking: a 200 OK response needs to be the only thing in the 'else' block after this 'else if'. Does AWS throw 'err' for every non-200 status? If not, then this will break the ability to know for sure the file exists and is OK. Also occurs on line 398/44