Skip to content

Commit

Permalink
Fix matching of request form
Browse files Browse the repository at this point in the history
  • Loading branch information
calvinmclean committed Aug 12, 2024
1 parent 392fd3c commit 327472e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cassette/cassette.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,13 @@ func (m *matcher) matcher(r *http.Request, i Request) bool {
return false
}

// Only ParseForm for non-GET requests since that would use query params
if r.Method == http.MethodPost || r.Method == http.MethodPut || r.Method == http.MethodPatch {
err := r.ParseForm()
if err != nil {
return false
}
}
if !m.deepEqualContents(r.Form, i.Form) {
return false
}
Expand Down

0 comments on commit 327472e

Please sign in to comment.