enhance: short url use "/p/short-id" instead of "/s/short-id"

This commit is contained in:
Tienson Qin
2025-12-30 00:48:43 +08:00
parent 74d136e49c
commit 12f967437f
2 changed files with 3 additions and 3 deletions

View File

@@ -91,7 +91,7 @@
"graph" (get data "graph_uuid")
"page_tags" page-tags
"short_id" short-id
"short_url" (when short-id (str "/s/" short-id))
"short_url" (when short-id (str "/p/" short-id))
"content_hash" (get data "content_hash")
"content_length" (get data "content_length"))))

View File

@@ -136,7 +136,7 @@
:graph_uuid graph-uuid
:r2_key r2-key
:short_id short-id
:short_url (str "/s/" short-id)
:short_url (str "/p/" short-id)
:updated_at (.now js/Date)})))))))))))
(defn handle-tag-page-html [graph-uuid tag-uuid env]
@@ -632,7 +632,7 @@
(js/Response. (.-body object)
#js {:headers headers}))))))))
(and (string/starts-with? path "/s/") (= method "GET"))
(and (string/starts-with? path "/p/") (= method "GET"))
(let [parts (string/split path #"/")
short-id (nth parts 2 nil)]
(if (string/blank? short-id)