Skip to content

Commit 4162a52

Browse files
committed
change static handler from m.Get to m.Any due to breaking compatibitily of routing order of martini
1 parent 19fd0af commit 4162a52

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

httpd.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ func (s *Server) Run() error {
9898
registered[path] = true
9999
rawPath := rawPaths[i]
100100
if rawPath != "" {
101-
m.Get(rawPath, func(w http.ResponseWriter, r *http.Request) {
101+
m.Any(rawPath, func(w http.ResponseWriter, r *http.Request) {
102102
http.Redirect(w, r, rawPath+"/", http.StatusFound)
103103
})
104104
}
@@ -111,7 +111,7 @@ func (s *Server) Run() error {
111111

112112
log.Printf("starting static file server for: %s", path)
113113
fileServer := http.FileServer(http.Dir(path))
114-
m.Get("/**", fileServer.ServeHTTP)
114+
m.Any("/**", fileServer.ServeHTTP)
115115

116116
log.Printf("starting server at %s", s.Conf.Addr)
117117

0 commit comments

Comments
 (0)