mirror of
https://github.com/GNS3/gns3-server.git
synced 2025-06-16 06:18:19 +00:00
Prevent deleting a GNS3 project outside the project directory. Ref #1669
This commit is contained in:
@ -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