From 970ed71d57652f5d731421441b0fbc2374171cff Mon Sep 17 00:00:00 2001 From: Patrick Ogenstad Date: Fri, 11 Oct 2024 17:44:19 +0200 Subject: [PATCH] Fix broken SDK playback Fixes #64 --- changelog/64.fixed.md | 1 + infrahub_sdk/playback.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelog/64.fixed.md diff --git a/changelog/64.fixed.md b/changelog/64.fixed.md new file mode 100644 index 00000000..06a070c6 --- /dev/null +++ b/changelog/64.fixed.md @@ -0,0 +1 @@ +Fix SDK playback hash generation to read the correct filename diff --git a/infrahub_sdk/playback.py b/infrahub_sdk/playback.py index 72e65954..3b1519fc 100644 --- a/infrahub_sdk/playback.py +++ b/infrahub_sdk/playback.py @@ -1,3 +1,4 @@ +import json from pathlib import Path from typing import Any, Optional @@ -44,7 +45,7 @@ def _read_request( ) -> httpx.Response: content: Optional[bytes] = None if payload: - content = str(ujson.dumps(payload)).encode("utf-8") + content = str(json.dumps(payload)).encode("UTF-8") request = httpx.Request(method=method.value, url=url, headers=headers, content=content) filename = generate_request_filename(request)