Add cache-busting timestamp to banner URL in --version

Prevents GitHub CDN from serving stale banner content.

https://claude.ai/code/session_015XtsgTMi8UtmgxEgb5Qt2c
This commit is contained in:
Claude 2026-05-16 15:28:00 +00:00
parent e3eb654996
commit 503eb3d83d
No known key found for this signature in database

View file

@ -11,6 +11,7 @@ import json
import os
import re
import ssl
import time
import urllib.error
import urllib.request
from pathlib import Path
@ -472,7 +473,7 @@ def _version_callback(ctx, param, value):
if not value or ctx.resilient_parsing:
return
click.echo(f"mdcms v{CLI_VERSION} (released {CLI_RELEASE_DATE})")
url = f"https://raw.githubusercontent.com/kbenestad/mdcms/refs/heads/main/docs/banner/v{CLI_VERSION}.txt"
url = f"https://raw.githubusercontent.com/kbenestad/mdcms/refs/heads/main/docs/banner/v{CLI_VERSION}.txt?t={int(time.time())}"
try:
ssl_ctx = ssl.create_default_context(cafile=certifi.where())
req = urllib.request.Request(url, headers={"User-Agent": f"mdcms/{CLI_VERSION}"})