瀏覽代碼

Merge pull request #136 from dutchcoders/ISSUE-57

Handle empty upload
tags/v1.0.0
Andrea Spacca 5 年之前
committed by GitHub
父節點
當前提交
bce4eec32c
沒有發現已知的金鑰在資料庫的簽署中 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 == "" {


Loading…
取消
儲存