diff options
author | Alex Schultz <aschultz@redhat.com> | 2021-06-11 11:13:19 -0600 |
---|---|---|
committer | Matthew Heon <mheon@redhat.com> | 2021-06-14 10:34:35 -0400 |
commit | f69789155aea0e41ab78c36d1ace9f7e57d44a68 (patch) | |
tree | ef9db5760c8cb26e7c5d5bde75913956e8c40e4d /pkg | |
parent | 5a158563c05ea533d95b73793462941bbea01281 (diff) | |
download | podman-f69789155aea0e41ab78c36d1ace9f7e57d44a68.tar.gz podman-f69789155aea0e41ab78c36d1ace9f7e57d44a68.tar.bz2 podman-f69789155aea0e41ab78c36d1ace9f7e57d44a68.zip |
Fall back to string for dockerfile parameter
a9cb824981db3fee6b8445b29e513c89e9b9b00b changed the expectations of the
dockerfile parameter to be json data however it's a string. In order to
support both, let's attempt json and fall back to a string if the json
parsing fails.
Closes #10660
Signed-off-by: Alex Schultz <aschultz@redhat.com>
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/api/handlers/compat/images_build.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/api/handlers/compat/images_build.go b/pkg/api/handlers/compat/images_build.go index 50423fb96..9c4dd8638 100644 --- a/pkg/api/handlers/compat/images_build.go +++ b/pkg/api/handlers/compat/images_build.go @@ -144,8 +144,8 @@ func BuildImage(w http.ResponseWriter, r *http.Request) { if _, found := r.URL.Query()["dockerfile"]; found { var m = []string{} if err := json.Unmarshal([]byte(query.Dockerfile), &m); err != nil { - utils.BadRequest(w, "dockerfile", query.Dockerfile, err) - return + // it's not json, assume just a string + m = append(m, query.Dockerfile) } containerFiles = m } else { |