|
|
|
@ -25,7 +25,7 @@ func compileCGIRegex(cgiDir string) *regexp.Regexp {
|
|
|
|
|
cgiDir = path.Join(Root, cgiDir)
|
|
|
|
|
}
|
|
|
|
|
SystemLog.Infof(cgiDirStr, cgiDir)
|
|
|
|
|
return regexp.MustCompile("(?m)" + cgiDir + "(|/.*)$")
|
|
|
|
|
return regexp.MustCompile("^" + cgiDir + "(|/.*)$")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// compileRestrictedPathsRegex turns a string of restricted paths into a slice of compiled regular expressions
|
|
|
|
@ -40,7 +40,7 @@ func compileRestrictedPathsRegex(restrictions string) []*regexp.Regexp {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Compile the regular expression
|
|
|
|
|
regex, err := regexp.Compile("(?m)" + expr + "$")
|
|
|
|
|
regex, err := regexp.Compile("^" + expr + "$")
|
|
|
|
|
if err != nil {
|
|
|
|
|
SystemLog.Fatalf(pathRestrictRegexCompileFailStr, expr)
|
|
|
|
|
}
|
|
|
|
@ -65,7 +65,7 @@ func compileHiddenPathsRegex(hidden string) []*regexp.Regexp {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Compile the regular expression
|
|
|
|
|
regex, err := regexp.Compile("(?m)" + expr + "$")
|
|
|
|
|
regex, err := regexp.Compile("^" + expr + "$")
|
|
|
|
|
if err != nil {
|
|
|
|
|
SystemLog.Fatalf(pathHidingRegexCompileFailStr, expr)
|
|
|
|
|
}
|
|
|
|
@ -96,7 +96,7 @@ func compileRequestRemapRegex(remaps string) []*RequestRemap {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Compile the regular expression
|
|
|
|
|
regex, err := regexp.Compile("(?m)" + strings.TrimPrefix(split[0], "/") + "$")
|
|
|
|
|
regex, err := regexp.Compile("^" + strings.TrimPrefix(split[0], "/") + "$")
|
|
|
|
|
if err != nil {
|
|
|
|
|
SystemLog.Fatalf(requestRemapRegexCompileFailStr, expr)
|
|
|
|
|
}
|
|
|
|
|