fix: HandleVolumeAdd validates host and container paths (closes #107)
This commit is contained in:
parent
ec87915234
commit
efd3500dac
@ -1022,6 +1022,14 @@ func (h *Handlers) HandleVolumeAdd() http.HandlerFunc {
|
||||
return
|
||||
}
|
||||
|
||||
pathErr := validateVolumePaths(hostPath, containerPath)
|
||||
if pathErr != nil {
|
||||
h.log.Error("invalid volume path", "error", pathErr)
|
||||
http.Redirect(writer, request, "/apps/"+application.ID, http.StatusSeeOther)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
volume := models.NewVolume(h.db)
|
||||
volume.AppID = application.ID
|
||||
volume.HostPath = hostPath
|
||||
|
||||
Loading…
Reference in New Issue
Block a user