Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kubitre committed Feb 12, 2022
1 parent 91e7259 commit 604e91b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions extractors/extract_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"net/http"
"reflect"

"github.com/gorilla/mux"
"github.com/kubitre/go_api_infra/response"
"github.com/spf13/cast"
)
Expand Down Expand Up @@ -66,8 +67,8 @@ func extractFromQuery(paramName string, request *http.Request) interface{} {
}

func extractFromPathVariables(paramName string, request *http.Request) interface{} {
vars := request.Context().Value(0).(map[string]interface{})
return vars[paramName].(string)
vars := mux.Vars(request)
return vars[paramName]
}

func extractFromHeaders(paramName string, request *http.Request) interface{} {
Expand Down

0 comments on commit 604e91b

Please sign in to comment.