Skip to content

Commit

Permalink
Make it possible to fall back on ad-hoc checksum calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
frankdejonge committed Oct 18, 2022
1 parent 8c88437 commit f4211ae
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions AwsS3V3Adapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Aws\Api\DateTimeResult;
use Aws\S3\S3ClientInterface;
use Generator;
use League\Flysystem\ChecksumAlgoIsNotSupported;
use League\Flysystem\ChecksumProvider;
use League\Flysystem\Config;
use League\Flysystem\DirectoryAttributes;
Expand Down Expand Up @@ -518,10 +519,10 @@ public function publicUrl(string $path, Config $config): string

public function checksum(string $path, Config $config): string
{
$algo = $config->get('checksum_algo', 'internal');
$algo = $config->get('checksum_algo', 'etag');

if ($algo !== 'internal') {
throw new UnableToProvideChecksum('Custom checksum algorithm is not supported', $path);
if ($algo !== 'etag') {
throw new ChecksumAlgoIsNotSupported();
}

try {
Expand Down

0 comments on commit f4211ae

Please sign in to comment.