XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet
公开
关注 0 Fork 0 Star 1
返回提交历史

XFEstudio/gpt4free

Fix latest_version handling in render function to correctly append query string

0f8853d9
hlohaus <983577+hlohaus@users.noreply.github.com>
提交于

代码差异

1 个文件 +1 -1
Modified g4f/gui/server/website.py +1 -1
@@ -32,6 +32,7 @@ def render(filename = "home", download_url: str = GITHUB_URL):
32 32 latest_version = version.utils.current_version
33 33 today = datetime.today().strftime('%Y-%m-%d')
34 34 cache_dir = os.path.join(get_cookies_dir(), ".gui_cache", today)
35 latest_version = str(latest_version) +quote(unquote(request.query_string.decode())) or str(latest_version)
35 36 cache_file = os.path.join(cache_dir, f"{secure_filename(f'{version.utils.current_version}-{latest_version}')}.{secure_filename(filename)}")
36 37 is_temp = False
37 38 if not os.path.exists(cache_file):
@@ -39,7 +40,6 @@ def render(filename = "home", download_url: str = GITHUB_URL):
39 40 is_temp = True
40 41 else:
41 42 os.makedirs(cache_dir, exist_ok=True)
42 latest_version = quote(unquote(request.query_string.decode())) or str(latest_version)
43 43 if html is None:
44 44 try:
45 45 response = requests.get(f"{download_url}{filename}")