Skip to content

Commit 218ff71

Browse files
authored
Fix issue with PR build hostname parsing (#8700)
Given a hostname `slug--bug--1.org.readthedocs.build`, the current parsing code will give a project slug of `slug` and a version slug of `bug--1`. This was a valid slug creation pattern for a short while, though we have changed the behavior of the slugging to not produce slugs with consecutive dashes. rsplit here searches for the right most instance of double slugs
1 parent 2cab501 commit 218ff71

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

readthedocs/proxito/middleware.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def map_host_to_project_slug(request): # pylint: disable=too-many-return-statem
8686
# Serve custom versions on external-host-domain
8787
if external_domain_parts == host_parts[1:]:
8888
try:
89-
project_slug, version_slug = host_parts[0].split('--', 1)
89+
project_slug, version_slug = host_parts[0].rsplit('--', 1)
9090
request.external_domain = True
9191
request.host_version_slug = version_slug
9292
log.debug('Proxito External Version Domain: host=%s', host)

0 commit comments

Comments
 (0)