From 8e726375cc9ad02616d0f23f6b03286d96e36c2c Mon Sep 17 00:00:00 2001 From: "francesco.cardinale" Date: Mon, 8 Apr 2024 11:57:05 +0200 Subject: [PATCH] Add handling for 301 (redirect) HTTP response codes --- tests/test_urls.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_urls.py b/tests/test_urls.py index 5cd07f0..6b4bb42 100644 --- a/tests/test_urls.py +++ b/tests/test_urls.py @@ -94,7 +94,8 @@ def test_url(): ret = request_url(requests.head, url) print(f"status_code: {ret}") - if ret.status_code != 200: + # Check if the response status code is 200 or 301 (redirect) + if ret.status_code not in [200, 301]: relative_path = extract_relative_path(url, root_dir) if relative_path: