Skip to content

Commit

Permalink
GetUrlWithParamNames fix index check error
Browse files Browse the repository at this point in the history
  • Loading branch information
kmsb12 committed Oct 30, 2024
1 parent 0ef907a commit 05c5cc6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion context.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,10 @@ func (c *Context) GetUrlWithParamNames() string {
if c.Request == nil || c.Request.URL == nil {
return ""
}

url := c.Request.URL.Path
for i, pvalue := range c.pvalues {
if pvalue == "" || len(c.pnames) < i {
if pvalue == "" || len(c.pnames) < i+1 {
break
}
lastIndex := strings.LastIndex(url, pvalue)
Expand Down

0 comments on commit 05c5cc6

Please sign in to comment.