minor consistency changes

Signed-off-by: kim (grufwub) <grufwub@gmail.com>
development
kim (grufwub) 4 years ago
parent 0c68a84861
commit 2dd51728a4

@ -69,7 +69,7 @@ func ParseFlagsAndSetup(proto string) {
// Check valid values for BindAddr and Hostname
if Hostname == "" {
if Bind == "" {
SystemLog.Fatalf(hostnameBindEmptyStr)
SystemLog.Fatal(hostnameBindEmptyStr)
}
Hostname = Bind
}
@ -112,40 +112,40 @@ func ParseFlagsAndSetup(proto string) {
// If no restricted paths provided, set to the disabled function. Else, compile and enable
if *restrictedPathsList == "" {
SystemLog.Infof(pathRestrictionsDisabledStr)
SystemLog.Info(pathRestrictionsDisabledStr)
IsRestrictedPath = isRestrictedPathDisabled
} else {
SystemLog.Infof(pathRestrictionsEnabledStr)
SystemLog.Info(pathRestrictionsEnabledStr)
restrictedPaths = compileRestrictedPathsRegex(*restrictedPathsList)
IsRestrictedPath = isRestrictedPathEnabled
}
// If no hidden paths provided, set to the disabled function. Else, compile and enable
if *hiddenPathsList == "" {
SystemLog.Infof(pathHidingDisableStr)
SystemLog.Info(pathHidingDisableStr)
IsHiddenPath = isHiddenPathDisabled
} else {
SystemLog.Infof(pathHidingEnabledStr)
SystemLog.Info(pathHidingEnabledStr)
hiddenPaths = compileHiddenPathsRegex(*hiddenPathsList)
IsHiddenPath = isHiddenPathEnabled
}
// If no remapped paths provided, set to the disabled function. Else, compile and enable
if *remapRequestsList == "" {
SystemLog.Infof(requestRemapDisabledStr)
SystemLog.Info(requestRemapDisabledStr)
RemapRequest = remapRequestDisabled
} else {
SystemLog.Infof(requestRemapEnabledStr)
SystemLog.Info(requestRemapEnabledStr)
requestRemaps = compileRequestRemapRegex(*remapRequestsList)
RemapRequest = remapRequestEnabled
}
// If no CGI dir supplied, set to disabled function. Else, compile and enable
if *cgiDir == "" {
SystemLog.Infof(cgiSupportDisabledStr)
SystemLog.Info(cgiSupportDisabledStr)
WithinCGIDir = withinCGIDirDisabled
} else {
SystemLog.Infof(cgiSupportEnabledStr)
SystemLog.Info(cgiSupportEnabledStr)
cgiDirRegex = compileCGIRegex(*cgiDir)
cgiEnv = setupInitialCGIEnv(*safePath)
WithinCGIDir = withinCGIDirEnabled
@ -153,10 +153,10 @@ func ParseFlagsAndSetup(proto string) {
// If no user dir supplied, set to disabled function. Else, set user dir and enable
if userDir == "" {
SystemLog.Infof(userDirDisabledStr)
SystemLog.Info(userDirDisabledStr)
getRequestPath = getRequestPathUserDirDisabled
} else {
SystemLog.Infof(userDirEnabledStr)
SystemLog.Info(userDirEnabledStr)
getRequestPath = getRequestPathUserDirEnabled
// Clean the user dir to be safe

@ -35,7 +35,7 @@ type RegularFileContent struct {
}
// Load takes an open FD and loads the file contents into FileContents memory
func (fc *RegularFileContent) Load(path *Path, file *os.File) *errors.Error {
func (fc *RegularFileContent) Load(p *Path, file *os.File) *errors.Error {
var err *errors.Error
fc.content, err = ReadFile(file)
return err

Loading…
Cancel
Save