Skip to content

Commit 59a70e9

Browse files
authored
remove redundant condition with aws sdk v3 when content type is no longer included in the query arg
1 parent 901d1f2 commit 59a70e9

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

src/Offload/Manager.php

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -158,14 +158,7 @@ public function uploadImage(string $filename, string $imageUrl): string
158158
}
159159

160160
$imageId = (string) $response['tableId'];
161-
$uploadUrl = (string) $response['uploadUrl'];
162-
$uploadUrlMimeType = preg_match('/Content-Type=([^&]*)/', urldecode($uploadUrl), $matches) ? $matches[1] : null;
163-
164-
if (!is_string($uploadUrlMimeType)) {
165-
throw new RuntimeException('Unable to parse content type from upload URL');
166-
} elseif (strtolower($fileMimeType) !== strtolower($uploadUrlMimeType)) {
167-
throw new RuntimeException(sprintf('File "%s" MIME type "%s" does not match upload URL MIME type "%s"', $filename, $fileMimeType, $uploadUrlMimeType));
168-
}
161+
$uploadUrl = (string) $response['uploadUrl'];
169162

170163
$image = file_get_contents($filename);
171164

0 commit comments

Comments
 (0)