Turn back token validation; Add AllowInsecure config

This commit is contained in:
DarthSim
2018-09-07 23:47:46 +06:00
parent a157a818f6
commit b0fb204381
2 changed files with 14 additions and 3 deletions

View File

@@ -408,9 +408,11 @@ func parsePath(r *http.Request) (string, processingOptions, error) {
return "", processingOptions{}, errors.New("Invalid path")
}
// if err := validatePath(parts[0], strings.TrimPrefix(path, fmt.Sprintf("/%s", parts[0]))); err != nil {
// return "", processingOptions{}, err
// }
if !conf.AllowInsecure {
if err := validatePath(parts[0], strings.TrimPrefix(path, fmt.Sprintf("/%s", parts[0]))); err != nil {
return "", processingOptions{}, err
}
}
if _, ok := resizeTypes[parts[1]]; ok {
return parsePathSimple(parts[1:])