Skip to content

Commit

Permalink
Fix missing - in public file bucket regex
Browse files Browse the repository at this point in the history
  • Loading branch information
emilong committed Jun 26, 2024
1 parent 9f46389 commit ca65d5e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/gcp_storage_emulator/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def _health_check(req, res, storage):
}, # Wipe all data
# Public file serving, same as object.download and signed URLs
{
PATH_PATTERN: r"^/(?P<bucket_name>[.\w]+)/(?P<object_id>.*[^/]+)$",
PATH_PATTERN: r"^/(?P<bucket_name>[-.\w]+)/(?P<object_id>.*[^/]+)$",
METHOD_MAP: {
GET: objects.download,
PUT: objects.xml_upload,
Expand Down Expand Up @@ -410,7 +410,9 @@ def handle(self, method):
break
else:
logger.error(
"Method not implemented: {} - {}".format(request.method, request.path)
"Method not implemented: {} {} - {}".format(
request.method, request.host, request.path
)
)
response.status = HTTPStatus.NOT_IMPLEMENTED

Expand Down

0 comments on commit ca65d5e

Please sign in to comment.