diff --git a/static_pages.py b/static_pages.py index 126065117..2ba9a4e4b 100644 --- a/static_pages.py +++ b/static_pages.py @@ -36,6 +36,9 @@ def serve(page_slug: str, file_path: str): blob_path = f"{WEBSITE_FOLDER_PATH}/{extract_file_name(file_path)}" if not (blob_path.endswith(".html")): + blob = bucket.get_blob(blob_path) + if not blob or not blob.exists(): + return None # 404 # redirect every path that doesn't end with .html return dict( redirectUrl=f"https://storage.googleapis.com/{settings.GS_BUCKET_NAME}/{blob_path}"