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:
parent
8d471a89a8
commit
0c90393b5b
@ -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__})
|
||||
|
@ -24,7 +24,6 @@ VERSION_SCHEMA = {
|
||||
"version": {
|
||||
"description": "Version number human readable",
|
||||
"type": "string",
|
||||
"minLength": 5,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user