diff --git a/internal/api/zone.go b/internal/api/zone.go index 1a152a0..e1512d4 100644 --- a/internal/api/zone.go +++ b/internal/api/zone.go @@ -65,13 +65,14 @@ func ReceiveFile(w http.ResponseWriter, r *http.Request) { return } + defer file.Close() //nolint: errcheck + ok := validateContentType(file) if !ok { http.Error(w, "file must be text/plain", http.StatusUnsupportedMediaType) return } - defer file.Close() //nolint: errcheck name := strings.Split(header.Filename, ".")