Skip to content
Merged
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
3 changes: 2 additions & 1 deletion guardrails/validators/endpoint_is_reachable.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from http import HTTPStatus
from typing import Any, Dict

from guardrails.logger import logger
Expand Down Expand Up @@ -31,7 +32,7 @@ def validate(self, value: Any, metadata: Dict) -> ValidationResult:
# Check that the URL exists and can be reached
try:
response = requests.get(value)
if response.status_code != 200:
if response.status_code != HTTPStatus.OK:
return FailResult(
error_message=f"URL {value} returned "
f"status code {response.status_code}",
Expand Down