1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-24 17:28:08 +00:00

Send explicit error message when client is checking for the server version.

This commit is contained in:
Jeremy 2015-02-01 16:55:08 -07:00
parent 8d471a89a8
commit 0c90393b5b
2 changed files with 4 additions and 4 deletions

View File

@ -29,7 +29,7 @@ class VersionHandler:
description="Retrieve the server version number",
output=VERSION_SCHEMA)
def version(request, response):
response.json({'version': __version__})
response.json({"version": __version__})
@classmethod
@Route.post(
@ -43,5 +43,6 @@ class VersionHandler:
})
def check_version(request, response):
if request.json["version"] != __version__:
raise HTTPConflict(reason="Invalid version")
response.json({'version': __version__})
raise HTTPConflict(text="Client version {} differs with server version {}".format(request.json["version"],
__version__))
response.json({"version": __version__})

View File

@ -24,7 +24,6 @@ VERSION_SCHEMA = {
"version": {
"description": "Version number human readable",
"type": "string",
"minLength": 5,
}
}
}