Skip to content

Commit 7c17a71

Browse files
ytn3rdbshaffer
authored andcommitted
Added check for if range exists when getting progress for resumable upload. (#1209)
1 parent bb58ef5 commit 7c17a71

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Google/Http/MediaFileUpload.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,11 @@ private function makePutRequest(RequestInterface $request)
165165

166166
if (308 == $this->httpResultCode) {
167167
// Track the amount uploaded.
168-
$range = explode('-', $response->getHeaderLine('range'));
169-
$this->progress = $range[1] + 1;
168+
$range = $response->getHeaderLine('range');
169+
if ($range) {
170+
$range_array = explode('-', $range);
171+
$this->progress = $range_array[1] + 1;
172+
}
170173

171174
// Allow for changing upload URLs.
172175
$location = $response->getHeaderLine('location');

0 commit comments

Comments
 (0)