ソースを参照

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 == "" {


読み込み中…
キャンセル
保存