mirror of
https://github.com/GNS3/gns3-server.git
synced 2024-12-20 05:17:56 +00:00
Merge pull request #1120 from GNS3/aiohttp_2.2
Upgrade to last aiohttp version
This commit is contained in:
commit
114b137b02
@ -43,8 +43,8 @@ import gns3server.handlers
|
||||
import logging
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
if not aiohttp.__version__.startswith("2.0"):
|
||||
raise RuntimeError("You need aiohttp 2.0 for running GNS3")
|
||||
if not aiohttp.__version__.startswith("2.2"):
|
||||
raise RuntimeError("aiohttp 2.0 is required to run the GNS3 server")
|
||||
|
||||
|
||||
class WebServer:
|
||||
|
@ -1,7 +1,7 @@
|
||||
jsonschema>=2.4.0
|
||||
aiohttp>=2.0.7,<2.1.0 # pyup: ignore
|
||||
aiohttp>=2.2.0,<2.3.0 # pyup: ignore
|
||||
aiohttp-cors>=0.5.3,<0.6.0 # pyup: ignore
|
||||
yarl>=0.10.2,<0.11 # pyup: ignore
|
||||
yarl>=0.11,<0.12 # pyup: ignore
|
||||
Jinja2>=2.7.3
|
||||
raven>=5.23.0
|
||||
psutil>=3.0.0
|
||||
|
@ -136,7 +136,7 @@ def test_get_file(http_compute, tmpdir):
|
||||
assert response.status == 404
|
||||
|
||||
response = http_compute.get("/projects/{project_id}/files/../hello".format(project_id=project.id), raw=True)
|
||||
assert response.status == 403
|
||||
assert response.status == 404
|
||||
|
||||
|
||||
def test_write_file(http_compute, tmpdir):
|
||||
@ -151,7 +151,7 @@ def test_write_file(http_compute, tmpdir):
|
||||
assert f.read() == "world"
|
||||
|
||||
response = http_compute.post("/projects/{project_id}/files/../hello".format(project_id=project.id), raw=True)
|
||||
assert response.status == 403
|
||||
assert response.status == 404
|
||||
|
||||
|
||||
def test_stream_file(http_compute, tmpdir):
|
||||
@ -170,4 +170,4 @@ def test_stream_file(http_compute, tmpdir):
|
||||
assert response.status == 404
|
||||
|
||||
response = http_compute.get("/projects/{project_id}/files/../hello".format(project_id=project.id), raw=True)
|
||||
assert response.status == 403
|
||||
assert response.status == 404
|
||||
|
@ -258,7 +258,7 @@ def test_upload_image_ova(http_compute, tmpdir):
|
||||
def test_upload_image_forbiden_location(http_compute, tmpdir):
|
||||
with patch("gns3server.compute.Qemu.get_images_directory", return_value=str(tmpdir),):
|
||||
response = http_compute.post("/qemu/images/../../test2", body="TEST", raw=True)
|
||||
assert response.status == 403
|
||||
assert response.status == 404
|
||||
|
||||
|
||||
def test_upload_image_permission_denied(http_compute, tmpdir):
|
||||
|
@ -234,7 +234,7 @@ def test_get_file(http_controller, tmpdir, project, node, compute):
|
||||
compute.http_query.assert_called_with("GET", "/projects/{project_id}/files/project-files/vpcs/{node_id}/hello".format(project_id=project.id, node_id=node.id), timeout=None, raw=True)
|
||||
|
||||
response = http_controller.get("/projects/{project_id}/nodes/{node_id}/files/../hello".format(project_id=project.id, node_id=node.id), raw=True)
|
||||
assert response.status == 403
|
||||
assert response.status == 404
|
||||
|
||||
|
||||
def test_post_file(http_controller, tmpdir, project, node, compute):
|
||||
@ -245,4 +245,4 @@ def test_post_file(http_controller, tmpdir, project, node, compute):
|
||||
compute.http_query.assert_called_with("POST", "/projects/{project_id}/files/project-files/vpcs/{node_id}/hello".format(project_id=project.id, node_id=node.id), data=b'hello', timeout=None, raw=True)
|
||||
|
||||
response = http_controller.get("/projects/{project_id}/nodes/{node_id}/files/../hello".format(project_id=project.id, node_id=node.id), raw=True)
|
||||
assert response.status == 403
|
||||
assert response.status == 404
|
||||
|
@ -203,7 +203,7 @@ def test_get_file(http_controller, tmpdir, loop, project):
|
||||
assert response.status == 404
|
||||
|
||||
response = http_controller.get("/projects/{project_id}/files/../hello".format(project_id=project.id), raw=True)
|
||||
assert response.status == 403
|
||||
assert response.status == 404
|
||||
|
||||
|
||||
def test_write_file(http_controller, tmpdir, project):
|
||||
@ -214,7 +214,7 @@ def test_write_file(http_controller, tmpdir, project):
|
||||
assert f.read() == "world"
|
||||
|
||||
response = http_controller.post("/projects/{project_id}/files/../hello".format(project_id=project.id), raw=True)
|
||||
assert response.status == 403
|
||||
assert response.status == 404
|
||||
|
||||
|
||||
def test_write_and_get_file_with_leading_slashes_in_filename(http_controller, tmpdir, loop, project):
|
||||
|
Loading…
Reference in New Issue
Block a user