Match the download url in the model whitelist (#3428)

check_whitelist_for_model compared save_path, base and filename with
the model list, but not the url the file is downloaded from, so a
request with a listed name and another url was queued as given.
Compare the url too.
This commit is contained in:
Perfect Johny
2026-11-13 20:27:02 +09:00
committed by GitHub
parent e66b7b71c7
commit 3ab17e228e
+2 -2
View File
@@ -1736,13 +1736,13 @@ async def check_whitelist_for_model(item):
json_obj = await core.get_data_by_mode('cache', 'model-list.json')
for x in json_obj.get('models', []):
if x['save_path'] == item['save_path'] and x['base'] == item['base'] and x['filename'] == item['filename']:
if x['save_path'] == item['save_path'] and x['base'] == item['base'] and x['filename'] == item['filename'] and x.get('url') == item.get('url'):
return True
json_obj = await core.get_data_by_mode('local', 'model-list.json')
for x in json_obj.get('models', []):
if x['save_path'] == item['save_path'] and x['base'] == item['base'] and x['filename'] == item['filename']:
if x['save_path'] == item['save_path'] and x['base'] == item['base'] and x['filename'] == item['filename'] and x.get('url') == item.get('url'):
return True
return False