Coverage for haystack/utils/url_validation.py: 100%

4 statements  

« prev     ^ index     » next       coverage.py v7.15.4, created at 2026-08-21 13:53 +0000

1# SPDX-FileCopyrightText: 2022-present deepset GmbH <info@deepset.ai> 

2# 

3# SPDX-License-Identifier: Apache-2.0 

4 

5from urllib.parse import urlparse 

6 

7 

8def is_valid_http_url(url: str) -> bool: 

9 """Check if a URL is a valid HTTP/HTTPS URL.""" 

10 r = urlparse(url) 

11 return all([r.scheme in ["http", "https"], r.netloc])