mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-10 03:28:53 +00:00
test(gemini): cover decoded delete file names
This commit is contained in:
parent
19f8c1013b
commit
87849b74b9
1 changed files with 13 additions and 0 deletions
|
|
@ -398,3 +398,16 @@ class TestGoogleAIStudioFilesTransformation:
|
|||
optional_params={},
|
||||
litellm_params=litellm_params,
|
||||
)
|
||||
|
||||
def test_transform_delete_file_request_rejects_deeply_encoded_traversal_url(self):
|
||||
litellm_params = {
|
||||
"api_key": "test-api-key",
|
||||
"api_base": "https://generativelanguage.googleapis.com",
|
||||
}
|
||||
|
||||
with pytest.raises(ValueError, match="Invalid Gemini file name"):
|
||||
self.handler.transform_delete_file_request(
|
||||
file_id="https://generativelanguage.googleapis.com/v1beta/files/..%2525252Fsecrets",
|
||||
optional_params={},
|
||||
litellm_params=litellm_params,
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue