mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Prevent deleting a GNS3 project outside the project directory. Ref #1669
This commit is contained in:
1 parent
f3ad333a21
commit
5e9810d420
2 files changed
+7
-3
No files matched your search
@@ -204,11 +204,12 @@ class ProjectHandler:
|
||||
|
||||
controller = Controller.instance()
|
||||
config = Config.instance()
|
||||
dot_gns3_file = request.json.get("path")
|
||||
if config.get_section_config("Server").getboolean("local", False) is False:
|
||||
log.error("Can't load the project the server is not started with --local")
|
||||
log.error("Cannot load '{}' because the server has not been started with the '--local' parameter".format(dot_gns3_file))
|
||||
response.set_status(403)
|
||||
return
|
||||
project = await controller.load_project(request.json.get("path"),)
|
||||
project = await controller.load_project(dot_gns3_file,)
|
||||
response.set_status(201)
|
||||
response.json(project)
|
||||
|
||||
|
||||
Reference in new issue
Block a user