From bf49fd81c8f959642124e712a5026368b4e970f2 Mon Sep 17 00:00:00 2001 From: Michel Roux Date: Wed, 21 Dec 2022 17:57:37 +0000 Subject: [PATCH] Use StringIO for response --- pynyaata/flarerequests.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pynyaata/flarerequests.py b/pynyaata/flarerequests.py index 5e9b324..382897d 100644 --- a/pynyaata/flarerequests.py +++ b/pynyaata/flarerequests.py @@ -1,3 +1,4 @@ +from io import StringIO from urllib import parse from requests import RequestException, Response, Session, post from .config import CLOUDPROXY_ENDPOINT @@ -41,7 +42,7 @@ class FlareRequests(Session): if "solution" in solution: resolved = Response() - resolved.raw = solution["solution"]["response"] + resolved.raw = StringIO(solution["solution"]["response"]) resolved.status_code = solution["solution"]["status"] resolved.headers = solution["solution"]["headers"] resolved.url = url