Home / Function/ test_https_only_mode() — langchain Function Reference

test_https_only_mode() — langchain Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

libs/core/tests/unit_tests/test_ssrf_protection.py lines 157–165

    def test_https_only_mode(self) -> None:
        """Test that HTTP is blocked when allow_http=False."""
        with pytest.raises(ValueError, match="HTTPS"):
            validate_safe_url("http://example.com/webhook", allow_http=False)

        # HTTPS should still work
        url = "https://example.com/webhook"
        result = validate_safe_url(url, allow_http=False)
        assert result == url

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free