0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-02 04:19:08 -05:00

Improve url resolution on assets handlers.

This commit is contained in:
Andrey Antukh 2021-01-25 16:14:06 +01:00 committed by Hirunatan
parent d68286821b
commit 340d1d43be

View file

@ -65,12 +65,7 @@
:fs
(let [purl (u/uri (:public-uri cfg))
path (sto/object->path obj)
purl (update purl :path
(fn [existing]
(if (str/ends-with? existing "/")
(str existing path)
(str existing "/" path))))]
purl (u/join purl (sto/object->relative-path obj))]
{:status 204
:headers {"x-accel-redirect" (:path purl)
"content-type" (:content-type mdata)