mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-10-09 02:52:12 -03:00
fix(civitai): surface missing-model diagnostics and anchor image-page URL parsing
- Return the ResourceNotFoundError detail from get_civitai_versions and get_model_versions_status instead of a bare "Model not found", and let the download modal display the server-provided message - Anchor extract_civitai_image_id / extractCivitaiImageId to ^/images/<id> so API paths and partial numeric IDs are rejected, same as the model-page parsing fix in #1140
This commit is contained in:
@@ -379,6 +379,12 @@ describe('civitaiUtils', () => {
|
||||
it('rejects image-like URLs from unsupported hosts', () => {
|
||||
expect(extractCivitaiImageId('https://example.com/images/126920345')).toBe(null);
|
||||
});
|
||||
|
||||
it.each(['civitai.com', 'civitai.red'])('rejects non-image pages on %s', (host) => {
|
||||
for (const path of ['/api/v1/images/126920345', '/images/126920345invalid']) {
|
||||
expect(extractCivitaiImageId(`https://${host}${path}`)).toBe(null);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
describe('classifyModelRelinkUrl', () => {
|
||||
|
||||
Reference in New Issue
Block a user