When executing:

```
s3AsyncClient.headBucket(HeadBucketRequest.builder()
                    .bucket("local-stack-test-bucket")
                    .build()).join();
```

We get this exception thrown (Java): java.util.concurrent.CompletionException: software.amazon.awssdk.services.s3.model.S3Exception: null (Service: S3, Status Code: 502, Request ID: null)

I narrowed this down to db4cddea4e4844c1241cca5ac22ecbde08e52064 and found the problem. PR incoming shortly.
elif not self.proxy.quiet or not conn_error:
                LOG.error(error_msg)
                if os.environ.get(ENV_INTERNAL_TEST_RUN):
                    
                    
                    
                    print('ERROR: %s' % error_msg)
            self.send_response(502)  
            self.end_headers()
            
            self.close_connection = 1
        finally:
            try:
                self.wfile.flush()
            except Exception as e:
                LOG.warning('Unable to flush write file: %s' % e)
    def _send_cors_headers(self, response=None):
        
        headers = response is not None and response.headers or {}
        if 'Access-Control-Allow-Origin' not in headers:
            self.send_header('Access-Control-Allow-Origin', '*')
        if 'Access-Control-Allow-Methods' not in headers:
            self.send_header('Access-Control-Allow-Methods', ','.join(CORS_ALLOWED_METHODS))
        if 'Access-Control-Allow-Headers' not in headers:
            requested_headers = self.headers.get('Access-Control-Request-Headers', '')
            requested_headers = re.split(r'[,\s]+', requested_headers) + CORS_ALLOWED_HEADERS
            self.send_header('Access-Control-Allow-Headers', ','.join([h for h in requested_headers if h]))
        if 'Access-Control-Expose-Headers' not in headers:
            self.send_header('Access-Control-Expose-Headers', ','.join(CORS_EXPOSE_HEADERS))
    def _listeners(self):