Home / Function/ test_localhost_allowed_with_flag() — langchain Function Reference

test_localhost_allowed_with_flag() — langchain Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

libs/core/tests/unit_tests/test_ssrf_protection.py lines 108–116

    def test_localhost_allowed_with_flag(self) -> None:
        """Test that localhost is allowed with allow_private=True."""
        url = "http://localhost:8080/webhook"
        result = validate_safe_url(url, allow_private=True)
        assert result == url

        url = "http://127.0.0.1:8080/webhook"
        result = validate_safe_url(url, allow_private=True)
        assert result == url

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free