updating query match string

This commit is contained in:
Bay Dodd
2015-07-17 08:40:28 +01:00
parent 19f0a91c4e
commit fe40f0d056
2 changed files with 16 additions and 3 deletions

View File

@@ -186,9 +186,13 @@ func (r *routeRegexp) getUrlQuery(req *http.Request) string {
if !r.matchQuery {
return ""
}
key := strings.Split(r.template, "=")[0]
val := req.URL.Query().Get(key)
return key + "=" + val
templateKey := strings.Split(r.template, "=")[0]
for key, vals := range req.URL.Query() {
if key == templateKey && len(vals) > 0 {
return key + "=" + vals[0]
}
}
return ""
}
func (r *routeRegexp) matchQueryString(req *http.Request) bool {