-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix "Queries" matcher to support out-of-order query string parameters #56
Conversation
for i := 0; i < length; i = 2 { | ||
buf.WriteString(fmt.Sprintf("%s=%s&", pairs[i], pairs[i 1])) | ||
if r.err = r.addRegexpMatcher(fmt.Sprintf("%s=%s", pairs[i], pairs[i 1]), false, true, true); r.err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using Sprintf here is probably overkill... how about just pairs[i] "=" pairs[i 1]
I've addressed both of your comments (thank you!). |
if queryVars != nil { | ||
for k, v := range v.query.varsN { | ||
m.Vars[v] = queryVars[k 1] | ||
if v.queries != nil && len(v.queries) > 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can actually skip this check entirely. Just leave the for _, q := range v.queries
loop below. It works with nil and 0-length slices. That will remove an indent level and make this code easier to grok.
Thanks, addressed both of these as well. |
Great. Reads much better now. |
Fix "Queries" matcher to support out-of-order query string parameters
No description provided.