Skip to content

Commit 122d173

Browse files
authored
Canonical URI reverse proxy workaround (boostorg#1961) (boostorg#1962)
1 parent 28aa850 commit 122d173

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libraries/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,12 +184,12 @@ def library_doc_latest_transform(url):
184184

185185
def generate_canonical_library_uri(uri):
186186
matches = re.match(
187-
r"(?P<domainpath>https?://[^/]+(?:/[^/]+){2}/?)(?P<version>[^/]+)(?P<docpath>/[\S]+)",
187+
r"https?://(?P<domainpath>[^/]+(?:/[^/]+){2}/?)(?P<version>[^/]+)(?P<docpath>/[\S]+)",
188188
uri,
189189
)
190190
if matches.group("version") == LATEST_RELEASE_URL_PATH_STR:
191191
return uri
192-
return f"{matches.group('domainpath')}{LATEST_RELEASE_URL_PATH_STR}{matches.group('docpath')}"
192+
return f"https://{matches.group('domainpath')}{LATEST_RELEASE_URL_PATH_STR}{matches.group('docpath')}"
193193

194194

195195
def get_documentation_url(library_version, latest):

0 commit comments

Comments
 (0)