Keep consistance of aiohttp.web.HTTPForbidden() execution

This commit is contained in:
ziajka committed 2017-11-23 16:28:10 +01:00
1 parent efbf7728ea
commit fe60c414b9
5 files changed
+9 -10

No files matched your search

@@ -15,7 +15,6 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import os
import aiohttp
from gns3server.web.route import Route
@@ -370,7 +369,7 @@ class NodeHandler:
# Raise error if user try to escape
if path[0] == ".":
raise aiohttp.web.HTTPForbidden
raise aiohttp.web.HTTPForbidden()
node_type = node.node_type
path = "/project-files/{}/{}/{}".format(node_type, node.id, path)
@@ -406,7 +405,7 @@ class NodeHandler:
# Raise error if user try to escape
if path[0] == ".":
raise aiohttp.web.HTTPForbidden
raise aiohttp.web.HTTPForbidden()
node_type = node.node_type
path = "/project-files/{}/{}/{}".format(node_type, node.id, path)
@@ -398,7 +398,7 @@ class ProjectHandler:
# Raise error if user try to escape
if path[0] == ".":
raise aiohttp.web.HTTPForbidden
raise aiohttp.web.HTTPForbidden()
path = os.path.join(project.path, path)
response.content_type = "application/octet-stream"
@@ -440,7 +440,7 @@ class ProjectHandler:
# Raise error if user try to escape
if path[0] == ".":
raise aiohttp.web.HTTPForbidden
raise aiohttp.web.HTTPForbidden()
path = os.path.join(project.path, path)
response.set_status(200)