@@ -14,6 +14,7 @@ import (
1414// StaticContentHandler it's a provider static content cloned from repository
1515func StaticContentHandler (w http.ResponseWriter , r * http.Request ) {
1616 repoConfig := utils .GetRepositoryConfigInstance ()
17+
1718 keys , ok := r .URL .Query ()["_branch" ]
1819
1920 branch := repoConfig .GetBranch ()
@@ -25,6 +26,15 @@ func StaticContentHandler(w http.ResponseWriter, r *http.Request) {
2526 }
2627
2728 basePath := utils .BuildBranchPath (repoConfig .GetTargetFolder (), branch )
29+
30+ if repoConfig .GetRootFolder () != "" {
31+ basePath = fmt .Sprintf ("%s/%s" , basePath , repoConfig .GetRootFolder ())
32+
33+ if strings .Contains (basePath , "//" ) {
34+ basePath = strings .ReplaceAll (basePath , "//" , "/" )
35+ }
36+ }
37+
2838 log .Printf ("[Request] Path %s" , basePath )
2939
3040 fs := http .FileServer (http .Dir (basePath ))
@@ -66,6 +76,15 @@ func PullHandler(w http.ResponseWriter, r *http.Request) {
6676 fmt .Fprintf (w , "Last commit [%s]" , commit .ToString ())
6777}
6878
79+ // FeatureNotEnabled it's a handler to response feature not enabled
80+ func FeatureNotEnabled (w http.ResponseWriter , r * http.Request ) {
81+
82+ w .WriteHeader (http .StatusNotAcceptable )
83+
84+ fmt .Fprintf (w , "Operation %s not supported with present configuration \n " , r .URL )
85+
86+ }
87+
6988// HealthCheckHandler it's a handler to return server status
7089func HealthCheckHandler (w http.ResponseWriter , r * http.Request ) {
7190 healthCheck := utils .GetHealthCheckControlInstance ()
0 commit comments