Skip to content

Commit

Permalink
Perform fuzzing and replay using localhost instead of 127.0.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
pyoor committed Sep 26, 2023
1 parent 522a7ac commit e7be349
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion grizzly/common/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def location(
Returns:
str: A valid URL.
"""
location = f"{scheme}://127.0.0.1:{srv_port}/{srv_path.lstrip('/')}"
location = f"{scheme}://localhost:{srv_port}/{srv_path.lstrip('/')}"
# set harness related arguments
args = []
if close_after is not None:
Expand Down
12 changes: 6 additions & 6 deletions grizzly/common/test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,17 +261,17 @@ def test_runner_07(mocker):
def test_runner_08():
"""test Runner.location()"""
result = Runner.location("a.html", 34567)
assert result == "http://127.0.0.1:34567/a.html"
assert result == "http://localhost:34567/a.html"
result = Runner.location("/a.html", 34567)
assert result == "http://127.0.0.1:34567/a.html"
assert result == "http://localhost:34567/a.html"
result = Runner.location("a.html", 34567, close_after=10)
assert result == "http://127.0.0.1:34567/a.html?close_after=10"
assert result == "http://localhost:34567/a.html?close_after=10"
result = Runner.location("a.html", 9999, time_limit=60)
assert result == "http://127.0.0.1:9999/a.html?time_limit=60000"
assert result == "http://localhost:9999/a.html?time_limit=60000"
result = Runner.location("a.html", 9999, close_after=10, time_limit=60)
assert result == "http://127.0.0.1:9999/a.html?close_after=10&time_limit=60000"
assert result == "http://localhost:9999/a.html?close_after=10&time_limit=60000"
result = Runner.location("a.html", 9999, post_launch_delay=10)
assert result == "http://127.0.0.1:9999/a.html?post_launch_delay=10"
assert result == "http://localhost:9999/a.html?post_launch_delay=10"


def test_runner_09(mocker):
Expand Down

0 comments on commit e7be349

Please sign in to comment.