Skip to content

Potential fix for code scanning alert no. 1: Incomplete URL substring sanitization #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion tests/test_config_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ def test_custom_url_logged(self, caplog):

# Check that the URL is mentioned in log messages
log_messages = [record.message for record in caplog.records]
assert any("https://test.api.com" in msg for msg in log_messages)
from urllib.parse import urlparse
parsed_url = urlparse("https://test.api.com")
expected_hostname = parsed_url.hostname
assert any(expected_hostname in urlparse(msg).hostname for msg in log_messages if urlparse(msg).hostname)

def test_default_url_logged(self, caplog):
"""Test that default API URL is logged in debug messages."""
Expand Down
Loading