Home / Function/ test_localhost_blocked_by_default() — langchain Function Reference

test_localhost_blocked_by_default() — langchain Function Reference

Architecture documentation for the test_localhost_blocked_by_default() function in test_ssrf_protection.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  5e6c7a97_7049_0667_e065_2d4167a742ac["test_localhost_blocked_by_default()"]
  55eb5d18_546a_f8ab_e6ce_af072e9c336d["TestValidateSafeUrl"]
  5e6c7a97_7049_0667_e065_2d4167a742ac -->|defined in| 55eb5d18_546a_f8ab_e6ce_af072e9c336d
  style 5e6c7a97_7049_0667_e065_2d4167a742ac fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/test_ssrf_protection.py lines 100–106

    def test_localhost_blocked_by_default(self) -> None:
        """Test that localhost URLs are blocked by default."""
        with pytest.raises(ValueError, match="Localhost"):
            validate_safe_url("http://localhost:8080/webhook")

        with pytest.raises(ValueError, match="localhost"):
            validate_safe_url("http://127.0.0.1:8080/webhook")

Domain

Subdomains

Frequently Asked Questions

What does test_localhost_blocked_by_default() do?
test_localhost_blocked_by_default() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/test_ssrf_protection.py.
Where is test_localhost_blocked_by_default() defined?
test_localhost_blocked_by_default() is defined in libs/core/tests/unit_tests/test_ssrf_protection.py at line 100.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free