moto/moto/s3/urls.py

19 lines
548 B
Python
Raw Normal View History

from __future__ import unicode_literals
from .responses import S3ResponseInstance
2013-03-05 13:14:43 +00:00
url_bases = [
2015-11-27 18:49:44 +00:00
"https?://s3(.*).amazonaws.com",
2014-07-09 00:35:48 +00:00
"https?://(?P<bucket_name>[a-zA-Z0-9\-_.]*)\.?s3(.*).amazonaws.com"
2013-03-05 13:14:43 +00:00
]
2013-02-18 21:09:40 +00:00
2013-03-05 13:14:43 +00:00
url_paths = {
2015-11-27 18:49:44 +00:00
# subdomain bucket
'{0}/$': S3ResponseInstance.bucket_response,
2015-11-27 18:49:44 +00:00
# subdomain key of path-based bucket
2015-11-27 19:43:03 +00:00
'{0}/(?P<key_or_bucket_name>.+)': S3ResponseInstance.ambiguous_response,
2015-11-27 18:49:44 +00:00
# path-based bucket + key
'{0}/(?P<bucket_name_path>[a-zA-Z0-9\-_./]+)/(?P<key_name>.+)': S3ResponseInstance.key_response,
2013-02-18 21:09:40 +00:00
}