Skip to content

Commit

Permalink
Changing firewall find HTTP method to POST.
Browse files Browse the repository at this point in the history
Prior definition was GET even though a search query payload needs to be transmitted in the request, which is invalid for certain HTTP clients.
  • Loading branch information
Gerrit91 committed Sep 21, 2020
1 parent 56d0187 commit 118b6ae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions cmd/metal-api/internal/service/firewall-service.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ package service

import (
"fmt"
"github.com/metal-stack/metal-api/cmd/metal-api/internal/grpc"
"net/http"

"github.com/metal-stack/metal-api/cmd/metal-api/internal/grpc"

"github.com/metal-stack/metal-lib/httperrors"
"github.com/metal-stack/metal-lib/zapup"
"go.uber.org/zap"
Expand Down Expand Up @@ -76,7 +77,7 @@ func (r firewallResource) webService() *restful.WebService {
Returns(http.StatusOK, "OK", v1.FirewallResponse{}).
DefaultReturns("Error", httperrors.HTTPErrorResponse{}))

ws.Route(ws.GET("/find").
ws.Route(ws.POST("/find").
To(viewer(r.findFirewalls)).
Operation("findFirewalls").
Doc("find firewalls by multiple criteria").
Expand Down
2 changes: 1 addition & 1 deletion spec/metal-api.json
Original file line number Diff line number Diff line change
Expand Up @@ -3053,7 +3053,7 @@
}
},
"/v1/firewall/find": {
"get": {
"post": {
"consumes": [
"application/json"
],
Expand Down

0 comments on commit 118b6ae

Please sign in to comment.