Skip to content

Commit

Permalink
fix an action router error
Browse files Browse the repository at this point in the history
  • Loading branch information
xgfone committed Jun 18, 2024
1 parent 942abd2 commit 08db910
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions http/router/action/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (

"github.com/xgfone/go-apiserver/http/middleware"
"github.com/xgfone/go-apiserver/http/reqresp"
"github.com/xgfone/go-apiserver/result/code"
"github.com/xgfone/go-apiserver/result/codeint"
)

// HeaderAction is the http header to store the action method.
Expand Down Expand Up @@ -106,9 +106,9 @@ func (r *Router) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
func notFoundHandler(resp http.ResponseWriter, req *http.Request) {
c := reqresp.GetContext(req.Context())
if len(c.Action) == 0 {
code.ErrBadRequestInvalidAction.WithMessage("missing the action").Respond(c)
codeint.ErrBadRequest.WithMessage("missing the action").Respond(c)
} else {
code.ErrBadRequestInvalidAction.WithMessage("action '%s' is unsupported", c.Action).Respond(c)
codeint.ErrBadRequest.WithMessage("action '%s' is unsupported", c.Action).Respond(c)
}
}

Expand Down

0 comments on commit 08db910

Please sign in to comment.