mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-28 11:18:11 +00:00
Send explicit error message when client is checking for the server version.
This commit is contained in:
parent
8d471a89a8
commit
0c90393b5b
@ -29,7 +29,7 @@ class VersionHandler:
|
|||||||
description="Retrieve the server version number",
|
description="Retrieve the server version number",
|
||||||
output=VERSION_SCHEMA)
|
output=VERSION_SCHEMA)
|
||||||
def version(request, response):
|
def version(request, response):
|
||||||
response.json({'version': __version__})
|
response.json({"version": __version__})
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@Route.post(
|
@Route.post(
|
||||||
@ -43,5 +43,6 @@ class VersionHandler:
|
|||||||
})
|
})
|
||||||
def check_version(request, response):
|
def check_version(request, response):
|
||||||
if request.json["version"] != __version__:
|
if request.json["version"] != __version__:
|
||||||
raise HTTPConflict(reason="Invalid version")
|
raise HTTPConflict(text="Client version {} differs with server version {}".format(request.json["version"],
|
||||||
response.json({'version': __version__})
|
__version__))
|
||||||
|
response.json({"version": __version__})
|
||||||
|
@ -24,7 +24,6 @@ VERSION_SCHEMA = {
|
|||||||
"version": {
|
"version": {
|
||||||
"description": "Version number human readable",
|
"description": "Version number human readable",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"minLength": 5,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user