Content-Length not required on remote objects.

For some reason, CDN stopped returning content length on some
objects. Making CL optional.
This commit is contained in:
Matt Butcher
2012-03-16 13:40:08 -05:00
parent 52003ccc58
commit df1542e56b

View File

@@ -132,7 +132,7 @@ class RemoteObject extends Object {
}
$object->setContentType($headers['Content-Type']);
$object->contentLength = (int) $headers['Content-Length'];
$object->contentLength = empty($headers['Content-Length']) ? 0 : (int) $headers['Content-Length'];
$object->etag = (string) $headers['Etag']; // ETag is now Etag.
$object->lastModified = strtotime($headers['Last-Modified']);