mirror of
https://github.com/boostorg/website-v2.git
synced 2026-01-19 04:42:17 +00:00
@@ -8,6 +8,7 @@ class SourceDocType(Enum):
|
||||
|
||||
|
||||
SLACK_URL = "https://cpplang.slack.com"
|
||||
STATIC_CONTENT_EARLY_EXIT_PATH_PREFIXES = ("releases/",)
|
||||
# possible library versions are: boost_1_53_0_beta1, 1_82_0, 1_55_0b1
|
||||
BOOST_LIB_PATH_RE = re.compile(r"^(boost_){0,1}([0-9_]*[0-9]+[^/]*)/(.*)")
|
||||
NO_PROCESS_LIBS = [
|
||||
|
||||
@@ -43,7 +43,11 @@ from .boostrenderer import (
|
||||
get_meta_redirect_from_html,
|
||||
get_s3_client,
|
||||
)
|
||||
from .constants import SourceDocType, BOOST_LIB_PATH_RE
|
||||
from .constants import (
|
||||
SourceDocType,
|
||||
BOOST_LIB_PATH_RE,
|
||||
STATIC_CONTENT_EARLY_EXIT_PATH_PREFIXES,
|
||||
)
|
||||
from .htmlhelper import (
|
||||
modernize_legacy_page,
|
||||
convert_name_to_id,
|
||||
@@ -249,6 +253,13 @@ class BaseStaticContentTemplateView(TemplateView):
|
||||
See the *_static_config.json files for URL mappings to specific S3 keys.
|
||||
"""
|
||||
content_path = self.kwargs.get("content_path")
|
||||
|
||||
# Exit early for paths we know we don't want to handle here. We know that these
|
||||
# paths should have been resolved earlier by the URL router, and if we return
|
||||
# a 404 here redirecting will be handled by the webserver configuration.
|
||||
if content_path.startswith(STATIC_CONTENT_EARLY_EXIT_PATH_PREFIXES):
|
||||
raise Http404("Content not found")
|
||||
|
||||
updated_legacy_path = legacy_path_transform(content_path)
|
||||
if updated_legacy_path != content_path:
|
||||
return redirect(
|
||||
|
||||
Reference in New Issue
Block a user