Support GET params for websocket ingress path (#22638)

This commit is contained in:
Pascal Vizeli 2019-04-02 02:41:08 +02:00 committed by Paulus Schoutsen
parent a7e613616c
commit e708032669
2 changed files with 7 additions and 1 deletions

View File

@ -71,9 +71,14 @@ class HassIOIngress(HomeAssistantView):
ws_server = web.WebSocketResponse()
await ws_server.prepare(request)
# Preparing
url = self._create_url(addon, path)
source_header = _init_header(request, addon)
# Support GET query
if request.query_string:
url = "{}?{}".format(url, request.query_string)
# Start proxy
async with self._websession.ws_connect(
url, headers=source_header

View File

@ -136,7 +136,8 @@ async def test_ingress_request_delete(
@pytest.mark.parametrize(
'build_type', [
("a3_vl", "test/beer/ws"), ("core", "ws.php"),
("local", "panel/config/stream"), ("jk_921", "hulk")
("local", "panel/config/stream"), ("jk_921", "hulk"),
("demo", "ws/connection?id=9&token=SJAKWS283")
])
async def test_ingress_websocket(
hassio_client, build_type, aioclient_mock):