(cherry picked from commit a9c392c13feb3cfe4100843eb41e0501e6708aaf)
Signed-off-by: Tim Liou <tim.liou@suse.com>
Co-authored-by: Tim Liou <tim.liou@suse.com>
* fix(image): Correctly handle query parameters in image URL validation
The imageUrl validator currently fails to correctly extract the file extension
when the image URL contains query parameters or fragments (e.g., 'image.qcow2?token=abc').
This change introduces a dedicated function, `getFilenameFromUrl`,
which uses the native URL object for robust parsing.
This ensures the file suffix validation is always performed on the actual filename,
ignoring any trailing parameters.
Signed-off-by: devsymo <devsymo@hotmail.com>
* fix(lint): Resolve formatting and spacing warnings
Signed-off-by: devsymo <devsymo@hotmail.com>
* fix: adjusted filename extraction logic and remove duplicate code
Signed-off-by: DevSymo <DevSymo@hotmail.com>
---------
Signed-off-by: devsymo <devsymo@hotmail.com>
Signed-off-by: DevSymo <DevSymo@hotmail.com>