fix(image): build image from file (#7929) [EE-4501]

pull/7941/head
Dmitry Salakhov 2 years ago committed by GitHub
parent a550bfaedb
commit 903cf284e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -29,9 +29,13 @@ type postDockerfileRequest struct {
func buildOperation(request *http.Request) error {
contentTypeHeader := request.Header.Get("Content-Type")
mediaType, _, err := mime.ParseMediaType(contentTypeHeader)
if err != nil {
return err
mediaType := ""
if contentTypeHeader != "" {
var err error
mediaType, _, err = mime.ParseMediaType(contentTypeHeader)
if err != nil {
return err
}
}
var buffer []byte
@ -49,7 +53,8 @@ func buildOperation(request *http.Request) error {
case "application/json":
var req postDockerfileRequest
if err := json.NewDecoder(request.Body).Decode(&req); err != nil {
err := json.NewDecoder(request.Body).Decode(&req)
if err != nil {
return err
}

Loading…
Cancel
Save