Fix root generation init not allowing empty input (#5495)

This commit is contained in:
Jeff Mitchell 2018-10-10 11:54:12 -04:00 committed by GitHub
parent 518f095cd7
commit d373b07f88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -5,6 +5,7 @@ import (
"encoding/hex"
"errors"
"fmt"
"io"
"net/http"
"github.com/hashicorp/vault/helper/base62"
@ -85,7 +86,7 @@ func handleSysGenerateRootAttemptGet(core *vault.Core, w http.ResponseWriter, r
func handleSysGenerateRootAttemptPut(core *vault.Core, w http.ResponseWriter, r *http.Request, generateStrategy vault.GenerateRootStrategy) {
// Parse the request
var req GenerateRootInitRequest
if err := parseRequest(r, w, &req); err != nil {
if err := parseRequest(r, w, &req); err != nil && err != io.EOF {
respondError(w, http.StatusBadRequest, err)
return
}