🐛 Fix regression on subpath support (#8793)

This commit is contained in:
Andrey Antukh 2026-03-26 15:43:30 +01:00 committed by GitHub
parent 0dfa62a5b6
commit 6db3c6cf89
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 15 additions and 11 deletions

View File

@ -9,6 +9,10 @@ localhost:3449 {
} }
http://localhost:3450 { http://localhost:3450 {
# For subpath test
# handle_path /penpot/* {
# reverse_proxy localhost:4449
# }
reverse_proxy localhost:4449 reverse_proxy localhost:4449
} }

View File

@ -179,12 +179,11 @@
([media] ([media]
(resolve-file-media media false)) (resolve-file-media media false))
([{:keys [id data-uri] :as media} thumbnail?] ([{:keys [id data-uri] :as media} thumbnail?]
(if data-uri (or data-uri
data-uri (dm/str
(dm/str (cond-> (u/join public-uri "assets/by-file-media-id/")
(cond-> (u/join public-uri "assets/by-file-media-id/") (true? thumbnail?) (u/join (dm/str id "/thumbnail"))
(true? thumbnail?) (u/join (dm/str id "/thumbnail")) (false? thumbnail?) (u/join (dm/str id)))))))
(false? thumbnail?) (u/join (dm/str id)))))))
(defn resolve-href (defn resolve-href
[resource] [resource]

View File

@ -8,6 +8,7 @@
(:require-macros [app.main.style :as stl]) (:require-macros [app.main.style :as stl])
(:require (:require
[app.common.data.macros :as dm] [app.common.data.macros :as dm]
[app.common.uri :as u]
[app.config :as cf] [app.config :as cf]
[app.main.data.common :as dcm] [app.main.data.common :as dcm]
[app.main.data.dashboard :as dd] [app.main.data.dashboard :as dd]
@ -95,8 +96,8 @@
(mf/defc card-item (mf/defc card-item
{::mf/wrap-props false} {::mf/wrap-props false}
[{:keys [item index is-visible collapsed on-import]}] [{:keys [item index is-visible collapsed on-import]}]
(let [id (dm/str "card-container-" index) (let [id (dm/str "card-container-" index)
thb (assoc cf/public-uri :path (dm/str "/images/thumbnails/template-" (:id item) ".jpg")) href (u/join cf/public-uri (dm/str "images/thumbnails/template-" (:id item) ".jpg"))
hover? (mf/use-state false) hover? (mf/use-state false)
on-click on-click
@ -124,7 +125,7 @@
:on-mouse-leave #(reset! hover? false) :on-mouse-leave #(reset! hover? false)
:on-key-down on-key-down} :on-key-down on-key-down}
[:div {:class (stl/css :img-container)} [:div {:class (stl/css :img-container)}
[:img {:src (dm/str thb) [:img {:src (dm/str href)
:alt (:name item) :alt (:name item)
:loading "lazy" :loading "lazy"
:decoding "async"}]] :decoding "async"}]]

View File

@ -32,7 +32,7 @@
(defn- google-font-id->uuid (defn- google-font-id->uuid
"Returns the UUID for a Google Font ID. Uses uuid/zero as fallback when the "Returns the UUID for a Google Font ID. Uses uuid/zero as fallback when the
font is not found in fontsdb. uuid/zero maps to the default font (Source font is not found in fontsdb. uuid/zero maps to the default font (Source
Sans Pro) in WASM. Sans Pro) in WASM.
A font id may not exist for different reasons: A font id may not exist for different reasons:
- the gfonts.json catalog was updated and fonts were renamed or removed, - the gfonts.json catalog was updated and fonts were renamed or removed,
@ -152,7 +152,7 @@
[font-id font-variant-id font-weight font-style] [font-id font-variant-id font-weight font-style]
(let [variant (font-db-data font-id font-variant-id font-weight font-style)] (let [variant (font-db-data font-id font-variant-id font-weight font-style)]
(if-let [ttf-url (:ttf-url variant)] (if-let [ttf-url (:ttf-url variant)]
(str/replace ttf-url "https://fonts.gstatic.com/s/" (u/join cf/public-uri "/internal/gfonts/font/")) (str/replace ttf-url "https://fonts.gstatic.com/s/" (u/join cf/public-uri "internal/gfonts/font/"))
nil))) nil)))
(defn- font-id->ttf-url (defn- font-id->ttf-url