getUrlQuery: Use SplitN with a max of 2.
This commit is contained in:
@@ -186,7 +186,7 @@ func (r *routeRegexp) getUrlQuery(req *http.Request) string {
|
|||||||
if !r.matchQuery {
|
if !r.matchQuery {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
templateKey := strings.Split(r.template, "=")[0]
|
templateKey := strings.SplitN(r.template, "=", 2)[0]
|
||||||
for key, vals := range req.URL.Query() {
|
for key, vals := range req.URL.Query() {
|
||||||
if key == templateKey && len(vals) > 0 {
|
if key == templateKey && len(vals) > 0 {
|
||||||
return key + "=" + vals[0]
|
return key + "=" + vals[0]
|
||||||
|
|||||||
Reference in New Issue
Block a user