Only validate URL if type is url
This commit is contained in:
@@ -27,6 +27,7 @@ func NewConfig(actionType string, actionData string) *Config {
|
||||
}
|
||||
|
||||
func (config *Config) Validate() {
|
||||
if config.ActionType == "url" {
|
||||
// Parse URL in config
|
||||
urlParser, err := url.Parse(config.ActionData)
|
||||
// If there was an error parsing
|
||||
@@ -43,6 +44,7 @@ func (config *Config) Validate() {
|
||||
log.Fatal().Msg("Invalid URL host")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Create config file
|
||||
func (config *Config) CreateFile(dir string) {
|
||||
|
||||
Reference in New Issue
Block a user