APIGateway: Allow semicolon in path (#6159)
This commit is contained in:
parent
d343981916
commit
0e58d3996b
@ -1734,7 +1734,7 @@ class APIGatewayBackend(BaseBackend):
|
||||
if not path_part:
|
||||
# We're attempting to create the default resource, which already exists.
|
||||
return api.default
|
||||
if not re.match("^\\{?[a-zA-Z0-9._-]+\\+?\\}?$", path_part):
|
||||
if not re.match("^\\{?[a-zA-Z0-9._\\-\\:]+\\+?\\}?$", path_part):
|
||||
raise InvalidResourcePathException()
|
||||
return api.add_child(path=path_part, parent_id=parent_resource_id)
|
||||
|
||||
|
@ -272,7 +272,7 @@ def test_create_resource__validate_name():
|
||||
]["id"]
|
||||
|
||||
invalid_names = ["/users", "users/", "users/{user_id}", "us{er", "us+er"]
|
||||
valid_names = ["users", "{user_id}", "{proxy+}", "user_09", "good-dog"]
|
||||
valid_names = ["users", "{user_id}", "{proxy+}", "{pro:xy+}", "us:er_0-9"]
|
||||
# All invalid names should throw an exception
|
||||
for name in invalid_names:
|
||||
with pytest.raises(ClientError) as ex:
|
||||
|
Loading…
Reference in New Issue
Block a user