Skip to content

Commit

Permalink
pr fix: remove DELETE from Command
Browse files Browse the repository at this point in the history
  • Loading branch information
thp-canonical committed Feb 14, 2024
1 parent 42cbc15 commit 89f05b6
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 7 deletions.
1 change: 0 additions & 1 deletion internals/daemon/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ func (s *apiSuite) TestSysInfo(c *check.C) {
c.Assert(sysInfoCmd.GET, check.NotNil)
c.Check(sysInfoCmd.PUT, check.IsNil)
c.Check(sysInfoCmd.POST, check.IsNil)
c.Check(sysInfoCmd.DELETE, check.IsNil)

rec := httptest.NewRecorder()

Expand Down
4 changes: 0 additions & 4 deletions internals/daemon/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ type Command struct {
GET ResponseFunc

Check failure on line 126 in internals/daemon/daemon.go

View workflow job for this annotation

GitHub Actions / lint

File is not `gci`-ed with --skip-generated -s standard -s default -s Prefix(github.com/canonical/pebble) (gci)
PUT ResponseFunc
POST ResponseFunc
DELETE ResponseFunc

// Access control.
ReadAccess accessChecker
Expand Down Expand Up @@ -185,9 +184,6 @@ func (c *Command) ServeHTTP(w http.ResponseWriter, r *http.Request) {
case "POST":
rspf = c.POST
access = c.WriteAccess
case "DELETE":
rspf = c.DELETE
access = c.WriteAccess
}

if rspf == nil {
Expand Down
3 changes: 1 addition & 2 deletions internals/daemon/daemon_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,8 @@ func (s *daemonSuite) TestCommandMethodDispatch(c *C) {
cmd.GET = rf
cmd.PUT = rf
cmd.POST = rf
cmd.DELETE = rf

for _, method := range []string{"GET", "POST", "PUT", "DELETE"} {
for _, method := range []string{"GET", "POST", "PUT"} {
req, err := http.NewRequest(method, "", nil)
req.Header.Add("User-Agent", fakeUserAgent)
c.Assert(err, IsNil)
Expand Down

0 comments on commit 89f05b6

Please sign in to comment.