mirror of
https://github.com/containers/podman.git
synced 2025-09-10 04:12:20 +08:00
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>
This commit is contained in:
@ -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 {
|
||||
|
Reference in New Issue
Block a user