further improve initial CGI path stripping

Signed-off-by: kim (grufwub) <grufwub@gmail.com>
development
kim (grufwub) 4 years ago
parent 27366e224e
commit 40a5e6e70e

@ -42,9 +42,10 @@ func generateCGIEnv(client *Client, request *Request, pathInfo string) []string
func TryExecuteCGIScript(client *Client, request *Request) *errors.Error {
// Get relative path with CGI dir stripped
partial := request.Path().Relative()[len(cgiPath.Relative()):]
if len(partial) > 0 && partial[0] == '/' {
partial = partial[1:]
if len(partial) == 0 {
return errors.NewError(RestrictedPathErr)
}
partial = partial[1:]
// Start with the CGI dir path
nextPath := cgiPath

@ -14,7 +14,7 @@ import (
const (
// Version holds the current version string
Version = "v3.1.8-beta4"
Version = "v3.1.8-beta5"
)
var (

Loading…
Cancel
Save