Skip to content

Commit

Permalink
Merge pull request #921 from iotaledger/fix/inx-apirequest-matching
Browse files Browse the repository at this point in the history
Fixed INX API request not matching the routes if a queryparam was passed
  • Loading branch information
muXxer authored Apr 19, 2024
2 parents 77a030b + 9808d29 commit adfae08
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion components/inx/server_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"bytes"
"context"
"net/http/httptest"
"net/url"

"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
Expand Down Expand Up @@ -47,7 +48,13 @@ func (s *Server) PerformAPIRequest(_ context.Context, req *inx.APIRequest) (*inx

rec := httptest.NewRecorder()
c := deps.Echo.NewContext(httpReq, rec)
deps.Echo.Router().Find(req.GetMethod(), req.GetPath(), c)

reqURL, err := url.Parse(req.GetPath())
if err != nil {
return nil, err
}

deps.Echo.Router().Find(req.GetMethod(), reqURL.Path, c)
if err := c.Handler()(c); err != nil {
return nil, err
}
Expand Down

0 comments on commit adfae08

Please sign in to comment.