[v1.x] fix: reject trailing newline in tool-name validation (#3086)
Co-authored-by: otiscuilei <otiscui@icloud.com>
This commit is contained in:
parent
5f0b6af9f2
commit
e8283746d0
1 changed files with 22 additions and 2 deletions
|
|
@ -66,12 +66,17 @@ class TestValidateToolName:
|
|||
("get,user,profile", "','"),
|
||||
("user/profile/update", "'/'"),
|
||||
("user@domain.com", "'@'"),
|
||||
# a single trailing newline slipped past `$` with re.match
|
||||
("valid_name\n", "'\\n'"),
|
||||
("a" * 127 + "\n", "'\\n'"),
|
||||
],
|
||||
ids=[
|
||||
"with_spaces",
|
||||
"with_commas",
|
||||
"with_slashes",
|
||||
"with_at_symbol",
|
||||
"with_trailing_newline",
|
||||
"max_length_with_trailing_newline",
|
||||
],
|
||||
)
|
||||
def test_rejects_invalid_characters(self, tool_name: str, expected_char: str) -> None:
|
||||
|
|
|
|||
Loading…
Reference in a new issue