fix: image attachment 404 on message display

keyboardstaff committed Feb 25, 2026 at 23:49 UTC cf8e66529b6136e46d72d2e0d7f580f2654a168e
3 files changed +4 -4
webui/components/chat/attachments/attachmentsStore.js
+1 -1
@@ -260,7 +260,7 @@ const model = {
260
261 // Generate server-side API URL for file (for device sync)
262 getServerImgUrl(filename) {
263 - return `/image_get?path=/a0/usr/uploads/${encodeURIComponent(filename)}`;
263 + return `/api/image_get?path=/a0/usr/uploads/${encodeURIComponent(filename)}`;
264 },
265
266 getServerFileUrl(filename) {
webui/components/chat/message-queue/message-queue-store.js
+1 -1
@@ -237,7 +237,7 @@ const model = {
237 },
238
239 getAttachmentUrl(filename) {
240 - return `/image_get?path=/a0/usr/uploads/${encodeURIComponent(filename)}`;
240 + return `/api/image_get?path=/a0/usr/uploads/${encodeURIComponent(filename)}`;
241 },
242 };
243
webui/js/messages.js
+2 -2
@@ -1723,7 +1723,7 @@ function drawKvpsIncremental(container, kvps, latex) {
1723 if (typeof value === "string" && value.startsWith("img://")) {
1724 const imgElement = document.createElement("img");
1725 imgElement.classList.add("kvps-img");
1726 - imgElement.src = value.replace("img://", "/image_get?path=");
1726 + imgElement.src = value.replace("img://", "/api/image_get?path=");
1727 imgElement.alt = "Image Attachment";
1728 tdiv.appendChild(imgElement);
1729
@@ -1789,7 +1789,7 @@ function convertHTML(str) {
1789 }
1790
1791 function convertImgFilePaths(str) {
1792 - return str.replace(/img:\/\//g, "/image_get?path=");
1792 + return str.replace(/img:\/\//g, "/api/image_get?path=");
1793 }
1794
1795 function convertFilePaths(str) {