Skip to content

Commit

Permalink
[dashboard] properly encode query string (ray-project#48823)
Browse files Browse the repository at this point in the history
for tests against `/test/http_get`

Signed-off-by: Lonnie Liu <lonnie@anyscale.com>
Signed-off-by: Connor Sanders <connor@elastiflow.com>
  • Loading branch information
aslonnie authored and jecsand838 committed Dec 4, 2024
1 parent 7be4f26 commit 42f64fd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions python/ray/dashboard/tests/test_dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import time
import warnings
from unittest.mock import MagicMock
from urllib.parse import quote_plus

import pytest
import requests
Expand Down Expand Up @@ -370,7 +371,9 @@ def test_http_get(enable_test_module, ray_start_with_dashboard):
while True:
time.sleep(3)
try:
response = requests.get(webui_url + "/test/http_get?url=" + target_url)
response = requests.get(
webui_url + "/test/http_get?url=" + quote_plus(target_url)
)
response.raise_for_status()
try:
dump_info = response.json()
Expand All @@ -385,7 +388,8 @@ def test_http_get(enable_test_module, ray_start_with_dashboard):
http_port, grpc_port = ports

response = requests.get(
f"http://{ip}:{http_port}" f"/test/http_get_from_agent?url={target_url}"
f"http://{ip}:{http_port}"
f"/test/http_get_from_agent?url={quote_plus(target_url)}"
)
response.raise_for_status()
try:
Expand Down

0 comments on commit 42f64fd

Please sign in to comment.