mirror of
https://github.com/kbenestad/mdcms.git
synced 2026-06-18 15:24:32 +00:00
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:
parent
e3eb654996
commit
503eb3d83d
1 changed files with 2 additions and 1 deletions
3
mdcms.py
3
mdcms.py
|
|
@ -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}"})
|
||||
|
|
|
|||
Loading…
Reference in a new issue