fix(api): fix endpointExtensionAddPayload validation

pull/1976/head
Anthony Lapenna 2018-06-18 15:30:44 +03:00
parent b4c2820ad7
commit 6698173bf5
1 changed files with 2 additions and 2 deletions

View File

@ -19,8 +19,8 @@ func (payload *endpointExtensionAddPayload) Validate(r *http.Request) error {
if payload.Type != 1 {
return portainer.Error("Invalid type value. Value must be one of: 1 (Storidge)")
}
if govalidator.IsNull(payload.URL) {
return portainer.Error("Invalid URL")
if payload.Type == 1 && govalidator.IsNull(payload.URL) {
return portainer.Error("Invalid extension URL")
}
return nil
}