Skip to content

Commit 86221f8

Browse files
committed
fix api_client.mustache
filename = os.path.basename(m.group(1))
1 parent 5da74e6 commit 86221f8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

modules/openapi-generator/src/main/resources/python/api_client.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,7 @@ class ApiClient:
723723
content_disposition
724724
)
725725
assert m is not None, "Unexpected 'content-disposition' header value"
726-
filename = m.group(1)
726+
filename = os.path.basename(m.group(1)) # Strip any directory traversal
727727
path = os.path.join(os.path.dirname(path), filename)
728728

729729
with open(path, "wb") as f:

0 commit comments

Comments
 (0)