소스 검색

Merge pull request #136 from dutchcoders/ISSUE-57

Handle empty upload
tags/v1.0.0
Andrea Spacca 5 년 전
committed by GitHub
부모
커밋
bce4eec32c
No known key found for this signature in database GPG 키 ID: 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 == "" {


불러오는 중...
취소
저장