From 2587d705fc33bfec258c3686ed1c3bbc034ef5f0 Mon Sep 17 00:00:00 2001 From: Michel Roux Date: Wed, 21 Dec 2022 18:12:20 +0000 Subject: [PATCH] Use BytesIO for Response --- pynyaata/flarerequests.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pynyaata/flarerequests.py b/pynyaata/flarerequests.py index 4212edb..a7e796b 100644 --- a/pynyaata/flarerequests.py +++ b/pynyaata/flarerequests.py @@ -1,4 +1,4 @@ -from io import StringIO +from io import BytesIO from urllib import parse from requests import RequestException, Response, Session, post from .config import CLOUDPROXY_ENDPOINT @@ -42,7 +42,7 @@ class FlareRequests(Session): if "solution" in solution: resolved = Response() - resolved.raw = StringIO(solution["solution"]["response"].encode()) + resolved.raw = BytesIO(solution["solution"]["response"].encode()) resolved.status_code = solution["solution"]["status"] resolved.headers = solution["solution"]["headers"] resolved.url = url