mirror of
https://github.com/openziti/zrok.git
synced 2026-09-28 02:06:31 -04:00
better test endpoint ui layout (#36)
This commit is contained in:
+2
-2
@@ -21,7 +21,7 @@ func StaticBuilder(handler http.Handler) http.Handler {
|
||||
logrus.Debugf("directing '%v' to static handler", r.URL.Path)
|
||||
|
||||
staticPath := "build"
|
||||
indexPath := "index.html"
|
||||
indexPath := "index.gohtml"
|
||||
|
||||
// get the absolute path to prevent directory traversal
|
||||
path, err := filepath.Abs(r.URL.Path)
|
||||
@@ -35,7 +35,7 @@ func StaticBuilder(handler http.Handler) http.Handler {
|
||||
|
||||
_, err = FS.Open(path)
|
||||
if os.IsNotExist(err) {
|
||||
// file does not exist, serve index.html
|
||||
// file does not exist, serve index.gohtml
|
||||
index, err := FS.ReadFile(filepath.Join(staticPath, indexPath))
|
||||
if err != nil {
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
|
||||
Reference in New Issue
Block a user