1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-30 20:28:08 +00:00

Raise an error if the destination of import contain a .gns3 in path

Ref https://github.com/GNS3/gns3-gui/issues/1503
This commit is contained in:
Julien Duponchelle 2016-09-14 18:53:26 +02:00
parent 84a2f8b4a3
commit 5b1ec3bec2
No known key found for this signature in database
GPG Key ID: CE8B29639E07F5E8

View File

@ -49,6 +49,9 @@ def import_project(controller, project_id, stream, location=None, name=None, kee
:returns: Project
"""
if location and ".gns3" in location:
raise aiohttp.web.HTTPConflict(text="The destination path should not contain .gns3")
with zipfile.ZipFile(stream) as myzip:
try: