```
        $args = [
            'version' => '2006-03-01',
            'region' => 'eu-west-1',
            'credentials' => CredentialsProvider::get(),
            'http' => ['decode_content' => false],
            'retries' => 6,
            'endpoint' => 'http://localstack:4572',
            'bucket_endpoint' => true
        ];

        $this->client = new S3Client($args);
        $result = $this->client->createBucket([
            'Bucket' => "localbucket",
        ]);
        $buckets = $this->client->listBuckets();
```

$result shows the `@metadata` statusCode as 200 however the returned Location which should tell me where the created bucket is, is an empty string. So it isn't creating the bucket, but I'm getting a 200 response. Just to be sure I run `listBuckets()` and it confirms nothing is being created.

docker-compose.yml settings for localstack:

```
    localstack:
        container_name: localstack
        image: localstack/localstack
        ports:
          - "4567-4593:4567-4593"
          - "${PORT_WEB_UI-8080}:${PORT_WEB_UI-8080}"
        environment:
          - HOSTNAME=pi.docker
          - SERVICES=s3,dynamodb
          - DEFAULT_REGION=eu-west-1
#            - DEBUG=${DEBUG- }
          - DATA_DIR=/tmp/localstack/data
          - PORT_WEB_UI=8080
#            - LAMBDA_EXECUTOR=local
          - DYNAMODB_ERROR_PROBABILITY=0.0
          - DOCKER_HOST=unix:///var/run/docker.sock
        volumes:
          - "${TMPDIR:-/tmp/localstack}:/tmp/localstack"
          - "/var/run/docker.sock:/var/run/docker.sock"
```

Bonus issue: as far as I can tell persistence for s3 doesn't work, I've set DATA_DIR, I've tried changing the volume to `"localstack:/tmp/localstack"` and setting a persisting volume for that. And the directory does persist, however the s3 data isn't stored here so it's reset when taking down the container.
path = to_str(path)
        method = to_str(method)
        bucket_name = get_bucket_name(path, headers)
        
        hostname_parts = headers['host'].split('.')
        if (not bucket_name or len(bucket_name) == 0) and len(hostname_parts) > 1:
            bucket_name = hostname_parts[0]
        
        
        key = None
        if method == 'POST':
            key, redirect_url = multipart_content.find_multipart_redirect_url(data, headers)
            if key and redirect_url:
                response.status_code = 303
                response.headers['Location'] = expand_redirect_url(redirect_url, key, bucket_name)
                LOGGER.debug('S3 POST {} to {}'.format(response.status_code, response.headers['Location']))
        parsed = urlparse.urlparse(path)
        bucket_name_in_host = headers['host'].startswith(bucket_name)
        should_send_notifications = all([
            method in ('PUT', 'POST', 'DELETE'),
            '/' in path[1:] or bucket_name_in_host,
            
            
            bucket_name_in_host or (len(path[1:].split('/')) > 1 and len(path[1:].split('/')[1]) > 0),
            self.is_query_allowable(method, parsed.query)
        ])