Skip to content

Commit 924f695

Browse files
committed
Use str.removesuffix() for consistent URL path handling
1 parent 7b8abd7 commit 924f695

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

scripts/portal-fetcher/openshift-docs-downloader.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,7 @@ def is_in_scope(url: str, base_url: str) -> bool:
126126
if "/html-single/" in base_path:
127127
# If this is a specific doc, make sure it's within that doc's URL path
128128
# Check if url_path starts with base_path or is the exact doc index
129-
is_in_scope = url_path.startswith(base_path) or url_path == base_path.rstrip(
130-
"/index"
131-
)
129+
is_in_scope = url_path.startswith(base_path) or url_path == base_path.removesuffix("/index")
132130
else:
133131
# For entire docs, anything with openshift_container_platform/VERSION in scope
134132
try:

0 commit comments

Comments
 (0)