Resolve non-absolute values of CGIPaths relative to DocBase. Closes #24.
This commit is contained in:
parent
2d6f4db38e
commit
8541b6194b
|
@ -319,7 +319,8 @@ startup, database connection etc. on each request).
|
|||
single non-separator character and `*` matches a sequence of them -
|
||||
if wildcards are used, the path should *not* end in a trailing slash
|
||||
- this appears to be a peculiarity of the Go standard library's
|
||||
`filepath.Glob` function.
|
||||
`filepath.Glob` function. Any non-absolute paths will be resolved
|
||||
relative to `DocBase`.
|
||||
* `SCGIPaths`: In this section of the config file, keys are URL path
|
||||
prefixes and values are filesystem paths to unix domain sockets.
|
||||
Any request for a URL whose path begins with one of the specified
|
||||
|
|
|
@ -92,6 +92,13 @@ func getConfig(filename string) (Config, error) {
|
|||
return config, errors.New("Invalid DirectorySort value.")
|
||||
}
|
||||
|
||||
// Absolutise CGI paths
|
||||
for index, cgiPath := range config.CGIPaths {
|
||||
if(!filepath.IsAbs(cgiPath)) {
|
||||
config.CGIPaths[index] = filepath.Join(config.DocBase, cgiPath)
|
||||
}
|
||||
}
|
||||
|
||||
// Expand CGI paths
|
||||
var cgiPaths []string
|
||||
for _, cgiPath := range config.CGIPaths {
|
||||
|
|
Loading…
Reference in New Issue