1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00

OSDOCS 11742 fix direct https includes with huge books

This commit is contained in:
Misha Ramendik
2024-08-20 18:09:20 +01:00
committed by openshift-cherrypick-robot
parent c2e39c8ecb
commit 9531c877e1

View File

@@ -621,7 +621,12 @@ def scrub_file(info, book_src_dir, src_file, tag=None, cwd=None):
# procedure loads the file recognizing that it starts with http
# it then checks if it exists or not, and if it exists, returns the raw data
# data that it finds.
if base_src_file.startswith("https://raw.githubusercontent.com/openshift/"):
# modified 20/Aug/2024 to process https links which are preceded
# by an added directory (happens with hugeBook)
https_pos = base_src_file.find("https://raw.githubusercontent.com/openshift/")
if https_pos >=0:
base_src_file = base_src_file[https_pos:]
try:
response = requests.get(base_src_file)
if response: