Skip to content

Commit 856b40e

Browse files
author
Sergio García Prado
committed
ISSUE #62
* Fix byte-based Request forwarding.
1 parent c88fce9 commit 856b40e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

minos/api_gateway/rest/handler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,13 @@ async def call(address: str, port: int, original_req: web.Request, user: Optiona
106106

107107
url = original_req.url.with_scheme("http").with_host(address).with_port(port)
108108
method = original_req.method
109-
content = await original_req.text()
109+
data = await original_req.read()
110110

111111
logger.info(f"Redirecting {method!r} request to {url!r}...")
112112

113113
try:
114114
async with ClientSession() as session:
115-
async with session.request(headers=headers, method=method, url=url, data=content) as response:
115+
async with session.request(headers=headers, method=method, url=url, data=data) as response:
116116
return await _clone_response(response)
117117
except ClientConnectorError:
118118
raise web.HTTPServiceUnavailable(text="The requested endpoint is not available.")

0 commit comments

Comments
 (0)