Skip to content

Commit

Permalink
Add str() guards to request_id before validation
Browse files Browse the repository at this point in the history
  • Loading branch information
ryn5 committed Feb 15, 2024
1 parent c7f3d24 commit 2f7669b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,14 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
=== TinkerPop 3.6.7 (NOT OFFICIALLY RELEASED YET)
* Fixed a bug in Gremlin.Net for .NET 8 that led to exceptions: `InvalidOperationException: Enumeration has not started. Call MoveNext.`
* Fixed message requestId serialization in `gremlin-python`.
* Improved error message from `JavaTranslator` by including exception source.
* Added missing `short` serialization (`gx:Int16`) to GraphSONV2 and GraphSONV3 in `gremlin-python`
* Added missing `short` serialization (`gx:Int16`) to GraphSONV2 and GraphSONV3 in `gremlin-python`.
* Added tests for error handling for GLV's if tx.commit() is called remotely for graphs without transactions support.
* Introduced multi-architecture AMD64/ARM64 docker images for gremlin-console.
* Fixed bug in `JavaTranslator` where `has(String, null)` could call `has(String, Traversal)` to generate an error.
* Fixed issue where server errors weren't being properly parsed when sending bytecode over HTTP.
* Improved bulkset contains check for elements if all elements in bulkset are of the same type
* Improved bulkset contains check for elements if all elements in bulkset are of the same type.
* Fixed bug in `EarlyLimitStrategy` which was too aggressive when promoting `limit()` before `map()`.
[[release-3-6-6]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,11 @@ def close(self):
def write(self, request_message):
if not self._inited:
self.connect()
request_id = str(uuid.uuid4())
if request_message.args.get("requestId"):
request_id = request_message.args.get("requestId")
uuid.UUID(request_id) # Checks for proper UUID or else server will return an error.
request_id = str(request_message.args.get("requestId"))
uuid.UUID(request_id) # Checks for proper UUID or else server will return an error.
else:
request_id = str(uuid.uuid4())
result_set = resultset.ResultSet(queue.Queue(), request_id)
self._results[request_id] = result_set
# Create write task
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ def build_message(self, request_id, processor, op, args):
def finalize_message(self, message, mime_len, mime_type):
ba = bytearray()

request_id = uuid.UUID(message['requestId'])
request_id = uuid.UUID(str(message['requestId']))
ba.extend(self.header_pack(mime_len, mime_type, 0x81,
(request_id.int >> 64) & self.max_int64, request_id.int & self.max_int64))

Expand Down

0 comments on commit 2f7669b

Please sign in to comment.