Skip to content

Commit

Permalink
remove checking space in update function payload (#367)
Browse files Browse the repository at this point in the history
  • Loading branch information
mthenw committed Feb 15, 2018
1 parent 7e0ba05 commit 76c0328
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
7 changes: 0 additions & 7 deletions httpapi/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,3 @@ type ErrMalformedJSON Error
func NewErrMalformedJSON(err error) *ErrMalformedJSON {
return &ErrMalformedJSON{fmt.Sprintf("Malformed JSON payload: %s.", err.Error())}
}

// ErrSpaceMismatch occurs when function couldn't been found in the discovery.
type ErrSpaceMismatch struct{}

func (e ErrSpaceMismatch) Error() string {
return "Object space doesn't match space specified in the URL."
}
7 changes: 0 additions & 7 deletions httpapi/httpapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,6 @@ func (h HTTPAPI) updateFunction(w http.ResponseWriter, r *http.Request, params h
return
}

if params.ByName("space") != fn.Space {
w.WriteHeader(http.StatusBadRequest)
responseErr := &ErrSpaceMismatch{}
encoder.Encode(&Response{Errors: []Error{{Message: responseErr.Error()}}})
return
}

fn.ID = function.ID(params.ByName("id"))
output, err := h.Functions.UpdateFunction(params.ByName("space"), fn)
if err != nil {
Expand Down

0 comments on commit 76c0328

Please sign in to comment.