Skip to content

Commit

Permalink
Place namespace ID in body for HTTP POST
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
  • Loading branch information
alexellis committed Jul 6, 2023
1 parent 7e7e690 commit 3f0ba36
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ func Serve(handlers *types.FaaSHandlers, config *types.FaaSConfig) {

// Only register the mutate namespace handler if it is defined
if handlers.MutateNamespace != nil {
r.HandleFunc("/system/namespace/{namespace:["+NameExpression+"]+}",
r.HandleFunc("/system/namespace/{namespace:["+NameExpression+"]*}",
hm.InstrumentHandler(handlers.MutateNamespace, "")).Methods(http.MethodPost, http.MethodDelete, http.MethodPut, http.MethodGet)
} else {
r.HandleFunc("/system/namespace/{namespace:["+NameExpression+"]+}",
r.HandleFunc("/system/namespace/{namespace:["+NameExpression+"]*}",
hm.InstrumentHandler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
http.Error(w, "Feature not implemented in this version of OpenFaaS", http.StatusNotImplemented)
}), "")).Methods(http.MethodGet)
Expand Down

0 comments on commit 3f0ba36

Please sign in to comment.