mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-20 07:18:07 +00:00
gns3z => gns3project
This commit is contained in:
parent
5c1522f24a
commit
936faaba5a
@ -361,8 +361,8 @@ class ProjectHandler:
|
|||||||
|
|
||||||
pm = ProjectManager.instance()
|
pm = ProjectManager.instance()
|
||||||
project = pm.get_project(request.match_info["project_id"])
|
project = pm.get_project(request.match_info["project_id"])
|
||||||
response.content_type = 'application/gns3z'
|
response.content_type = 'application/gns3project'
|
||||||
response.headers['CONTENT-DISPOSITION'] = 'attachment; filename="{}.gns3z"'.format(project.name)
|
response.headers['CONTENT-DISPOSITION'] = 'attachment; filename="{}.gns3project"'.format(project.name)
|
||||||
response.enable_chunked_encoding()
|
response.enable_chunked_encoding()
|
||||||
# Very important: do not send a content length otherwise QT close the connection but curl can consume the Feed
|
# Very important: do not send a content length otherwise QT close the connection but curl can consume the Feed
|
||||||
response.content_length = None
|
response.content_length = None
|
||||||
|
@ -294,8 +294,8 @@ def test_export(server, tmpdir, loop, project):
|
|||||||
|
|
||||||
response = server.get("/projects/{project_id}/export".format(project_id=project.id), raw=True)
|
response = server.get("/projects/{project_id}/export".format(project_id=project.id), raw=True)
|
||||||
assert response.status == 200
|
assert response.status == 200
|
||||||
assert response.headers['CONTENT-TYPE'] == 'application/gns3z'
|
assert response.headers['CONTENT-TYPE'] == 'application/gns3project'
|
||||||
assert response.headers['CONTENT-DISPOSITION'] == 'attachment; filename="{}.gns3z"'.format(project.name)
|
assert response.headers['CONTENT-DISPOSITION'] == 'attachment; filename="{}.gns3project"'.format(project.name)
|
||||||
|
|
||||||
with open(str(tmpdir / 'project.zip'), 'wb+') as f:
|
with open(str(tmpdir / 'project.zip'), 'wb+') as f:
|
||||||
f.write(response.body)
|
f.write(response.body)
|
||||||
|
Loading…
Reference in New Issue
Block a user