mirror of
https://github.com/1f349/lavender.git
synced 2025-02-23 06:05:08 +00:00
Fix loading astro islands
This commit is contained in:
parent
7760129db2
commit
363439e69b
@ -17,6 +17,7 @@ import (
|
|||||||
"github.com/julienschmidt/httprouter"
|
"github.com/julienschmidt/httprouter"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
"path"
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -98,13 +99,13 @@ func SetupRouter(r *httprouter.Router, config conf.Conf, mailSender *mail.Mail,
|
|||||||
r.POST("/logout", hs.RequireAuthentication(hs.logoutPost))
|
r.POST("/logout", hs.RequireAuthentication(hs.logoutPost))
|
||||||
|
|
||||||
// theme styles
|
// theme styles
|
||||||
r.GET("/assets/*filepath", func(rw http.ResponseWriter, req *http.Request, params httprouter.Params) {
|
r.GET("/_astro/*filepath", func(rw http.ResponseWriter, req *http.Request, params httprouter.Params) {
|
||||||
name := params.ByName("filepath")
|
name := params.ByName("filepath")
|
||||||
if strings.Contains(name, "..") {
|
if strings.Contains(name, "..") {
|
||||||
http.Error(rw, http.StatusText(http.StatusBadRequest), http.StatusBadRequest)
|
http.Error(rw, http.StatusText(http.StatusBadRequest), http.StatusBadRequest)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
web.RenderWebAsset(rw, req, name)
|
web.RenderWebAsset(rw, req, path.Join("_astro", name))
|
||||||
})
|
})
|
||||||
|
|
||||||
// login steps
|
// login steps
|
||||||
|
@ -17,7 +17,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
//go:embed dist
|
//go:embed all:dist
|
||||||
webDist embed.FS
|
webDist embed.FS
|
||||||
|
|
||||||
webCombinedDir fs.FS
|
webCombinedDir fs.FS
|
||||||
|
Loading…
x
Reference in New Issue
Block a user