misc: use only pathname to build image live preview URL (#88053)
gitea/wcs/pipeline/head This commit looks good Details

Change introduced by #33301 used the full URL which may also contain a
query string or a fragment identifier making the resulting URL invalid.
This commit is contained in:
Benjamin Dauvergne 2024-03-12 12:24:55 +01:00
parent a130f1d862
commit 96bfaea4a7
1 changed files with 1 additions and 1 deletions

View File

@ -461,7 +461,7 @@ $.WcsFileUpload = {
image_preview: function(base_widget, img_token) {
var file_button = base_widget.find('.file-button');
if(file_button.hasClass("file-image")) {
file_button[0].style.setProperty('--image-preview-url', `url(${window.location.href}tempfile?t=${img_token}&thumbnail=1)`);
file_button[0].style.setProperty('--image-preview-url', `url(${window.location.pathname}tempfile?t=${img_token}&thumbnail=1)`);
}
}
}