Spaces:
Sleeping
Sleeping
Update components/middleware.py
Browse files- components/middleware.py +2 -2
components/middleware.py
CHANGED
|
@@ -173,9 +173,9 @@ class x401Kit(BaseHTTPMiddleware):
|
|
| 173 |
|
| 174 |
if response.headers.get("content-type") == "application/json":
|
| 175 |
|
| 176 |
-
|
| 177 |
async for chunk in response.body_iterator:
|
| 178 |
-
|
| 179 |
|
| 180 |
try:
|
| 181 |
data = json.loads(body_bytes.decode())
|
|
|
|
| 173 |
|
| 174 |
if response.headers.get("content-type") == "application/json":
|
| 175 |
|
| 176 |
+
body_bytes = b""
|
| 177 |
async for chunk in response.body_iterator:
|
| 178 |
+
body_bytes += chunk
|
| 179 |
|
| 180 |
try:
|
| 181 |
data = json.loads(body_bytes.decode())
|