Home / Function/ test_invalid_scheme_blocked() — langchain Function Reference

test_invalid_scheme_blocked() — langchain Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

libs/core/tests/unit_tests/test_ssrf_protection.py lines 146–155

    def test_invalid_scheme_blocked(self) -> None:
        """Test that non-HTTP(S) schemes are blocked."""
        with pytest.raises(ValueError, match="scheme"):
            validate_safe_url("ftp://example.com/file")

        with pytest.raises(ValueError, match="scheme"):
            validate_safe_url("file:///etc/passwd")

        with pytest.raises(ValueError, match="scheme"):
            validate_safe_url("javascript:alert(1)")

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free