Skip to content

Commit

Permalink
feat: add check for query params
Browse files Browse the repository at this point in the history
  • Loading branch information
Neeraj319 committed Dec 30, 2023
1 parent 80b501d commit ec3f8b9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions router.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,10 @@ func callHandler(handler interface{}, pathArray []string, handerObj *RouteHandle

func (r *SimpleRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) {
url := req.URL.String()
i := strings.IndexRune(url, '?')
if i != -1 {
url = url[:i]
}
pathArray := strings.Split(url, "/")
pathArray = removeBlankStrings(pathArray)

Expand Down

0 comments on commit ec3f8b9

Please sign in to comment.