diff --git a/routers/static_filter.go b/routers/static_filter.go index 0d649879..9dbf4d02 100644 --- a/routers/static_filter.go +++ b/routers/static_filter.go @@ -77,6 +77,7 @@ func StaticFilter(ctx *context.Context) { panic(err) } dir = strings.ReplaceAll(dir, "\\", "/") + ctx.ResponseWriter.WriteHeader(http.StatusNotFound) errorText := fmt.Sprintf("The Casdoor frontend HTML file: \"index.html\" was not found, it should be placed at: \"%s/web/build/index.html\". For more information, see: https://casdoor.org/docs/basic/server-installation/#frontend-1", dir) http.ServeContent(ctx.ResponseWriter, ctx.Request, "Casdoor frontend has encountered error...", time.Now(), strings.NewReader(errorText)) return