Skip to content

Commit

Permalink
Update for invoke: 201 is not an error
Browse files Browse the repository at this point in the history
When a function was invoked via faas-cli and returned a 201,
the CLI classified this as an error. It isn't.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
  • Loading branch information
alexellis committed Apr 11, 2024
1 parent d0bffb1 commit 2aec1d6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion proxy/invoke.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func InvokeFunction(gateway string, name string, bytesIn *[]byte, contentType st
switch res.StatusCode {
case http.StatusAccepted:
fmt.Fprintf(os.Stderr, "Function submitted asynchronously.\n")
case http.StatusOK:
case http.StatusOK, http.StatusCreated:
var readErr error
resBytes, readErr = io.ReadAll(res.Body)
if readErr != nil {
Expand Down

0 comments on commit 2aec1d6

Please sign in to comment.