OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
cream
/
aws-ses
/
vendor
/
aws
/
aws-sdk-php
/
src
/
S3
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
05/19/2025 10:07:21 AM
rwxr-xr-x
📄
AmbiguousSuccessParser.php
2.3 KB
05/19/2025 10:07:20 AM
rw-r--r--
📄
ApplyChecksumMiddleware.php
4.98 KB
05/19/2025 10:07:20 AM
rw-r--r--
📄
BatchDelete.php
7.73 KB
05/19/2025 10:07:20 AM
rw-r--r--
📄
BucketEndpointArnMiddleware.php
14.04 KB
05/19/2025 10:07:20 AM
rw-r--r--
📄
BucketEndpointMiddleware.php
3.44 KB
05/19/2025 10:07:20 AM
rw-r--r--
📄
CalculatesChecksumTrait.php
1.84 KB
05/19/2025 10:07:20 AM
rw-r--r--
📁
Crypto
-
05/19/2025 10:07:20 AM
rwxr-xr-x
📄
EndpointRegionHelperTrait.php
3.26 KB
05/19/2025 10:07:20 AM
rw-r--r--
📁
Exception
-
05/19/2025 10:07:20 AM
rwxr-xr-x
📄
GetBucketLocationParser.php
1.34 KB
05/19/2025 10:07:20 AM
rw-r--r--
📄
MultipartCopy.php
9.06 KB
05/19/2025 10:07:20 AM
rw-r--r--
📄
MultipartUploader.php
6.3 KB
05/19/2025 10:07:20 AM
rw-r--r--
📄
MultipartUploadingTrait.php
4.24 KB
05/19/2025 10:07:20 AM
rw-r--r--
📄
ObjectCopier.php
5.99 KB
05/19/2025 10:07:20 AM
rw-r--r--
📄
ObjectUploader.php
5.52 KB
05/19/2025 10:07:20 AM
rw-r--r--
📄
PermanentRedirectMiddleware.php
1.76 KB
05/19/2025 10:07:20 AM
rw-r--r--
📄
PostObject.php
3.99 KB
05/19/2025 10:07:20 AM
rw-r--r--
📄
PostObjectV4.php
5.49 KB
05/19/2025 10:07:20 AM
rw-r--r--
📄
PutObjectUrlMiddleware.php
1.61 KB
05/19/2025 10:07:20 AM
rw-r--r--
📁
RegionalEndpoint
-
05/19/2025 10:07:20 AM
rwxr-xr-x
📄
RetryableMalformedResponseParser.php
1.47 KB
05/19/2025 10:07:20 AM
rw-r--r--
📄
S3Client.php
52.19 KB
05/19/2025 10:07:20 AM
rw-r--r--
📄
S3ClientInterface.php
14.47 KB
05/19/2025 10:07:20 AM
rw-r--r--
📄
S3ClientTrait.php
10.56 KB
05/19/2025 10:07:20 AM
rw-r--r--
📄
S3EndpointMiddleware.php
11.39 KB
05/19/2025 10:07:20 AM
rw-r--r--
📄
S3MultiRegionClient.php
19.96 KB
05/19/2025 10:07:20 AM
rw-r--r--
📄
S3UriParser.php
5.07 KB
05/19/2025 10:07:20 AM
rw-r--r--
📄
SSECMiddleware.php
2.31 KB
05/19/2025 10:07:20 AM
rw-r--r--
📄
StreamWrapper.php
31.65 KB
05/19/2025 10:07:20 AM
rw-r--r--
📄
Transfer.php
15.58 KB
05/19/2025 10:07:20 AM
rw-r--r--
📁
UseArnRegion
-
05/19/2025 10:07:20 AM
rwxr-xr-x
📄
ValidateResponseChecksumParser.php
5.23 KB
05/19/2025 10:07:20 AM
rw-r--r--
Editing: BucketEndpointMiddleware.php
Close
<?php namespace Aws\S3; use Aws\CommandInterface; use Psr\Http\Message\RequestInterface; /** * Used to update the host used for S3 requests in the case of using a * "bucket endpoint" or CNAME bucket. * * IMPORTANT: this middleware must be added after the "build" step. * * @internal */ class BucketEndpointMiddleware { private static $exclusions = ['GetBucketLocation' => true]; private $nextHandler; /** * Create a middleware wrapper function. * * @return callable */ public static function wrap() { return function (callable $handler) { return new self($handler); }; } public function __construct(callable $nextHandler) { $this->nextHandler = $nextHandler; } public function __invoke(CommandInterface $command, RequestInterface $request) { $nextHandler = $this->nextHandler; $bucket = $command['Bucket']; if ($bucket && !isset(self::$exclusions[$command->getName()])) { $request = $this->modifyRequest($request, $command); } return $nextHandler($command, $request); } /** * Performs a one-time removal of Bucket from path, then if * the bucket name is duplicated in the path, performs additional * removal which is dependent on the number of occurrences of the bucket * name in a path-like format in the key name. * * @return string */ private function removeBucketFromPath($path, $bucket, $key) { $occurrencesInKey = $this->getBucketNameOccurrencesInKey($key, $bucket); do { $len = strlen($bucket) + 1; if (substr($path, 0, $len) === "/{$bucket}") { $path = substr($path, $len); } } while (substr_count($path, "/{$bucket}") > $occurrencesInKey + 1); return $path ?: '/'; } private function removeDuplicateBucketFromHost($host, $bucket) { if (substr_count($host, $bucket) > 1) { while (strpos($host, "{$bucket}.{$bucket}") === 0) { $hostArr = explode('.', $host); array_shift($hostArr); $host = implode('.', $hostArr); } } return $host; } private function getBucketNameOccurrencesInKey($key, $bucket) { $occurrences = 0; if (empty($key)) { return $occurrences; } $segments = explode('/', $key); foreach($segments as $segment) { if (strpos($segment, $bucket) === 0) { $occurrences++; } } return $occurrences; } private function modifyRequest( RequestInterface $request, CommandInterface $command ) { $key = isset($command['Key']) ? $command['Key'] : null; $uri = $request->getUri(); $path = $uri->getPath(); $host = $uri->getHost(); $bucket = $command['Bucket']; $path = $this->removeBucketFromPath($path, $bucket, $key); $host = $this->removeDuplicateBucketFromHost($host, $bucket); // Modify the Key to make sure the key is encoded, but slashes are not. if ($key) { $path = S3Client::encodeKey(rawurldecode($path)); } return $request->withUri( $uri->withHost($host) ->withPath($path) ); } }