Support S3 virtual host URLs
S3 has two different kinds of requests: Path-style requests (https://s3.Region.amazonaws.com/bucket-name/key name
) and Virtual Hosted-Style Requests (https://bucket-name.s3.Region.amazonaws.com/key name
)
Currently only the paths are supported by our server, because it's way easier. But S3 wants to switch more or less completely to the hosted-style, so we should at least support them as well.
That means, we need to extract the bucketname from the URL by finding out, what part of the URL is the server, to remove this from the string (we can't just take everything to the first '.', because bucketnames can have '.' as well)
Also probably the tests will get more complicated that way, since DNS name resolving will be involved then.
Edited by Sophie Wenzel-Teuber