修复材质提供路径
This commit is contained in:
parent
4ca9b70e4a
commit
5c590ac78f
@ -8,7 +8,6 @@ import (
|
|||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
"strings"
|
|
||||||
|
|
||||||
"github.com/go-playground/validator/v10"
|
"github.com/go-playground/validator/v10"
|
||||||
"github.com/julienschmidt/httprouter"
|
"github.com/julienschmidt/httprouter"
|
||||||
@ -83,7 +82,6 @@ func (y *Yggdrasil) YggdrasilRoot() httprouter.Handle {
|
|||||||
func (y *Yggdrasil) TextureAssets() httprouter.Handle {
|
func (y *Yggdrasil) TextureAssets() httprouter.Handle {
|
||||||
return func(w http.ResponseWriter, r *http.Request, p httprouter.Params) {
|
return func(w http.ResponseWriter, r *http.Request, p httprouter.Params) {
|
||||||
w.Header().Set("Content-Type", "image/png")
|
w.Header().Set("Content-Type", "image/png")
|
||||||
r.RequestURI = strings.TrimPrefix(r.RequestURI, "/texture/")
|
http.StripPrefix("/texture/", http.FileServer(http.Dir(y.config.TexturePath))).ServeHTTP(w, r)
|
||||||
http.FileServer(http.Dir(y.config.TexturePath)).ServeHTTP(w, r)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user