mirror of
https://github.com/dutchcoders/transfer.sh.git
synced 2024-11-27 14:40:18 +01:00
Handle empty upload
This commit is contained in:
parent
bc694eccbd
commit
163faf569a
1 changed files with 6 additions and 0 deletions
|
@ -397,6 +397,12 @@ func (s *Server) putHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
contentLength = n
|
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")
|
contentType := r.Header.Get("Content-Type")
|
||||||
|
|
||||||
if contentType == "" {
|
if contentType == "" {
|
||||||
|
|
Loading…
Reference in a new issue