Переглянути джерело

Merge pull request #136 from dutchcoders/ISSUE-57

Handle empty upload
tags/v1.0.0
Andrea Spacca 5 роки тому
committed by GitHub
джерело
коміт
bce4eec32c
Не вдалося знайти GPG ключ що відповідає даному підпису Ідентифікатор GPG ключа: 4AEE18F83AFDEB23
1 змінених файлів з 6 додано та 0 видалено
  1. +6
    -0
      server/handlers.go

+ 6
- 0
server/handlers.go Переглянути файл

@@ -397,6 +397,12 @@ func (s *Server) putHandler(w http.ResponseWriter, r *http.Request) {
contentLength = n
}

if contentLength == 0 {
log.Print("Empty content-length")
http.Error(w, errors.New("Could not uplpoad empty file").Error(), 400)
return
}

contentType := r.Header.Get("Content-Type")

if contentType == "" {


Завантаження…
Відмінити
Зберегти