diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-08-04 12:20:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-04 12:20:25 +0200 |
commit | f7440ffaf68a03392daf79c67e45cb59ee1b7112 (patch) | |
tree | 0450874b0a47f22aca40d50af617d44ca8095e17 | |
parent | 861702e0263927f2b063033bc480c8927b1f7e6b (diff) | |
parent | 246603041cc72f4c43befe91de38ddf5aa085728 (diff) | |
download | podman-f7440ffaf68a03392daf79c67e45cb59ee1b7112.tar.gz podman-f7440ffaf68a03392daf79c67e45cb59ee1b7112.tar.bz2 podman-f7440ffaf68a03392daf79c67e45cb59ee1b7112.zip |
Merge pull request #7205 from baude/issue7185
docker-compose uses application/tar
-rw-r--r-- | pkg/api/handlers/compat/images_build.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/pkg/api/handlers/compat/images_build.go b/pkg/api/handlers/compat/images_build.go index 3005063a7..9601f5e18 100644 --- a/pkg/api/handlers/compat/images_build.go +++ b/pkg/api/handlers/compat/images_build.go @@ -20,6 +20,7 @@ import ( "github.com/containers/podman/v2/pkg/api/handlers/utils" "github.com/containers/storage/pkg/archive" "github.com/gorilla/schema" + "github.com/sirupsen/logrus" ) func BuildImage(w http.ResponseWriter, r *http.Request) { @@ -33,7 +34,13 @@ func BuildImage(w http.ResponseWriter, r *http.Request) { } if hdr, found := r.Header["Content-Type"]; found && len(hdr) > 0 { - if hdr[0] != "application/x-tar" { + contentType := hdr[0] + switch contentType { + case "application/tar": + logrus.Warnf("tar file content type is %s, should use \"application/x-tar\" content type", contentType) + case "application/x-tar": + break + default: utils.BadRequest(w, "Content-Type", hdr[0], fmt.Errorf("Content-Type: %s is not supported. Should be \"application/x-tar\"", hdr[0])) return |