moto/moto/s3/utils.py
2013-02-23 22:26:46 -05:00

9 lines
202 B
Python

import re
bucket_name_regex = re.compile("(.+).s3.amazonaws.com")
def bucket_name_from_hostname(hostname):
bucket_result = bucket_name_regex.search(hostname)
return bucket_result.groups()[0]