mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
go files serve RequestURI -> URL.Path.
This commit is contained in:
parent
a5c90f6198
commit
afb416ea57
@ -36,7 +36,7 @@ func New(conf *config.Server, webSocketHandler types.WebSocketHandler) *Server {
|
|||||||
|
|
||||||
fs := http.FileServer(http.Dir(conf.Static))
|
fs := http.FileServer(http.Dir(conf.Static))
|
||||||
router.Get("/*", func(w http.ResponseWriter, r *http.Request) {
|
router.Get("/*", func(w http.ResponseWriter, r *http.Request) {
|
||||||
if _, err := os.Stat(conf.Static + r.RequestURI); !os.IsNotExist(err) {
|
if _, err := os.Stat(conf.Static + r.URL.Path); !os.IsNotExist(err) {
|
||||||
fs.ServeHTTP(w, r)
|
fs.ServeHTTP(w, r)
|
||||||
} else {
|
} else {
|
||||||
w.WriteHeader(http.StatusNotFound)
|
w.WriteHeader(http.StatusNotFound)
|
||||||
|
Loading…
Reference in New Issue
Block a user