summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authoropenshift-ci[bot] <75433959+openshift-ci[bot]@users.noreply.github.com>2021-08-12 01:45:47 +0000
committerGitHub <noreply@github.com>2021-08-12 01:45:47 +0000
commit25ff04dcbe3212db6f72d08f3f904154bab4c0fe (patch)
tree333b81c805ebed0a69d1a1ad9f7f3624f2c89e99 /pkg
parentd594046410ec2f001697c957dc628e401e293ca5 (diff)
parent5a32946d61fd282d0801208ae414111626c79768 (diff)
downloadpodman-25ff04dcbe3212db6f72d08f3f904154bab4c0fe.tar.gz
podman-25ff04dcbe3212db6f72d08f3f904154bab4c0fe.tar.bz2
podman-25ff04dcbe3212db6f72d08f3f904154bab4c0fe.zip
Merge pull request #11167 from jwhonce/issues/11012
For compatibility, ignore Content-Type
Diffstat (limited to 'pkg')
-rw-r--r--pkg/api/handlers/compat/images_build.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/pkg/api/handlers/compat/images_build.go b/pkg/api/handlers/compat/images_build.go
index 08d1df4b8..0fcca1821 100644
--- a/pkg/api/handlers/compat/images_build.go
+++ b/pkg/api/handlers/compat/images_build.go
@@ -34,13 +34,16 @@ func BuildImage(w http.ResponseWriter, r *http.Request) {
contentType := hdr[0]
switch contentType {
case "application/tar":
- logrus.Warnf("tar file content type is %s, should use \"application/x-tar\" content type", contentType)
+ logrus.Infof("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
+ if utils.IsLibpodRequest(r) {
+ utils.BadRequest(w, "Content-Type", hdr[0],
+ fmt.Errorf("Content-Type: %s is not supported. Should be \"application/x-tar\"", hdr[0]))
+ return
+ }
+ logrus.Infof("tar file content type is %s, should use \"application/x-tar\" content type", contentType)
}
}