repos / pico

pico services - prose.sh, pastes.sh, imgs.sh, feeds.sh, pgs.sh
git clone https://github.com/picosh/pico.git

commit
494540f
parent
d520b3d
author
Eric Bower
date
2023-06-17 14:56:20 +0000 UTC
fix(prose): `/raw/` endpoints should take priority over aliases
1 files changed,  +2, -2
M prose/api.go
+2, -2
 1@@ -849,8 +849,8 @@ func createMainRoutes(staticRoutes []shared.Route) []shared.Route {
 2 		shared.NewRoute("GET", "/([^/]+)/blog/index.xml", rssBlogHandler),
 3 		shared.NewRoute("GET", "/([^/]+)/feed.xml", rssBlogHandler),
 4 		shared.NewRoute("GET", "/([^/]+)/_styles.css", blogStyleHandler),
 5-		shared.NewRoute("GET", "/([^/]+)/(.+)", postHandler),
 6 		shared.NewRoute("GET", "/raw/([^/]+)/(.+)", postRawHandler),
 7+		shared.NewRoute("GET", "/([^/]+)/(.+)", postHandler),
 8 	)
 9 
10 	return routes
11@@ -875,8 +875,8 @@ func createSubdomainRoutes(staticRoutes []shared.Route) []shared.Route {
12 
13 	routes = append(
14 		routes,
15-		shared.NewRoute("GET", "/(.+)", postHandler),
16 		shared.NewRoute("GET", "/raw/(.+)", postRawHandler),
17+		shared.NewRoute("GET", "/(.+)", postHandler),
18 	)
19 
20 	return routes