From cb2639e66bc651f70f3fc65f43da9284d181735e Mon Sep 17 00:00:00 2001 From: Lili Cosic Date: Mon, 26 Mar 2018 10:42:19 +0200 Subject: [PATCH] Fix unpacking update request --- pkg/rest/apisurface.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pkg/rest/apisurface.go b/pkg/rest/apisurface.go index bb43cd1..a784301 100644 --- a/pkg/rest/apisurface.go +++ b/pkg/rest/apisurface.go @@ -420,15 +420,17 @@ func (s *APISurface) UpdateHandler(w http.ResponseWriter, r *http.Request) { func unpackUpdateRequest(r *http.Request) (*osb.UpdateInstanceRequest, error) { osbRequest := &osb.UpdateInstanceRequest{} + if err := unmarshalRequestBody(r, osbRequest); err != nil { + return nil, err + } vars := mux.Vars(r) - osbRequest.ServiceID = vars[osb.VarKeyServiceID] + osbRequest.InstanceID = vars[osb.VarKeyInstanceID] - planID := vars[osb.VarKeyPlanID] - if planID != "" { - osbRequest.PlanID = &planID + asyncQueryParamVal := r.FormValue(osb.AcceptsIncomplete) + if strings.ToLower(asyncQueryParamVal) == "true" { + osbRequest.AcceptsIncomplete = true } - identity, err := retrieveOriginatingIdentity(r) // This could be not found because platforms may support the feature // but are not guaranteed to.