mirror of
https://github.com/axllent/mailpit.git
synced 2025-01-26 03:52:09 +02:00
Feature: Expand custom webroot path to include a-z A-Z 0-9 _ . - and /
@see #64
This commit is contained in:
parent
7675cd162f
commit
b905ba4ec5
@ -160,9 +160,9 @@ func VerifyConfig() error {
|
||||
SMTPAuth = a
|
||||
}
|
||||
|
||||
validWebrootRe := regexp.MustCompile(`[^0-9a-zA-Z\/-]`)
|
||||
validWebrootRe := regexp.MustCompile(`[^0-9a-zA-Z\/\-\_\.]`)
|
||||
if validWebrootRe.MatchString(Webroot) {
|
||||
return fmt.Errorf("Invalid characters in Webroot (%s). Valid chars: a-z, A-Z, 0-9, - and /", Webroot)
|
||||
return fmt.Errorf("Invalid characters in Webroot (%s). Valid chars include: [a-z A-Z 0-9 _ . - /]", Webroot)
|
||||
}
|
||||
|
||||
s := strings.TrimRight(path.Join("/", Webroot, "/"), "/") + "/"
|
||||
|
Loading…
x
Reference in New Issue
Block a user