Skip to content

Commit

Permalink
Mandatory server field in INIT response
Browse files Browse the repository at this point in the history
  • Loading branch information
technige committed Oct 23, 2018
1 parent f0e01eb commit a455db5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
20 changes: 10 additions & 10 deletions boltkit/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,16 +318,16 @@ def handle_request(self, sock):

responses = self.script.match_responses()
if not responses and self.script.match_auto_request(request):
try:
# This is hard-coded for GOODBYE. Maybe
# not very future proof.
if request[0] == CLIENT[v]["GOODBYE"]:
log.info("S: <EXIT>")
exit(0)
except KeyError:
pass
responses = [(SERVER[v]["SUCCESS"], {u"fields": []}
if request[0] == CLIENT[v]["RUN"] else {})]
# These are hard-coded and therefore not very future-proof.
if request[0] in (CLIENT[v].get("HELLO"), CLIENT[v].get("INIT")):
responses = [(SERVER[v]["SUCCESS"], {u"server": u"Neo4j/9.99.999"})]
elif request[0] == CLIENT[v].get("GOODBYE"):
log.info("S: <EXIT>")
exit(0)
elif request[0] == CLIENT[v]["RUN"]:
responses = [(SERVER[v]["SUCCESS"], {u"fields": []})]
else:
responses = [(SERVER[v]["SUCCESS"], {})]
for response in responses:
if isinstance(response, tuple):
data = packed(response)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
packages = find_packages(exclude=("test", "test.*"))
package_metadata = {
"name": "boltkit",
"version": "1.1.0",
"version": "1.2.0",
"description": "Toolkit for Neo4j 3.0+ driver authors",
"author": "Neo Technology",
"author_email": "drivers@neo4j.com",
Expand Down

0 comments on commit a455db5

Please sign in to comment.