Skip to content

Commit

Permalink
http server: support absolute path to dir
Browse files Browse the repository at this point in the history
see #65623
  • Loading branch information
martinrode committed Sep 5, 2022
1 parent 794a76c commit 773ed61
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion http_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ func (ats *Suite) StartHttpServer() {

if ats.HttpServer.Dir == "" {
ats.httpServerDir = ats.manifestDir
} else if filepath.IsAbs(ats.HttpServer.Dir) {
ats.httpServerDir = filepath.Clean(ats.HttpServer.Dir)
} else {
ats.httpServerDir = filepath.Clean(ats.manifestDir + "/" + ats.HttpServer.Dir)
ats.httpServerDir = filepath.Join(ats.manifestDir, ats.HttpServer.Dir)
}
mux.Handle("/", logH(ats.Config.LogShort, customStaticHandler(http.FileServer(http.Dir(ats.httpServerDir)))))

Expand Down

0 comments on commit 773ed61

Please sign in to comment.