Skip to content

Commit

Permalink
fix: passing json
Browse files Browse the repository at this point in the history
  • Loading branch information
NarekA committed Dec 5, 2023
1 parent 7fbe42f commit 676ca4c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions jina/serve/runtimes/gateway/request_handling.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import itertools
import json
from typing import TYPE_CHECKING, AsyncIterator, Dict

from aiohttp.client import _RequestContextManager
Expand Down Expand Up @@ -164,9 +165,9 @@ async def _load_balance(self, request):
'params': request.query,
}
try:
payload = await request.content.read()
payload = await request.read()
if payload:
request_kwargs['data'] = payload
request_kwargs['json'] = json.loads(payload.decode())
except Exception:
self.logger.debug('No JSON payload found in request')

Expand Down

0 comments on commit 676ca4c

Please sign in to comment.