assaf / node-replay

When API testing slows you down: record and replay HTTP responses like a boss
http://documentup.com/assaf/node-replay
MIT License
522 stars 107 forks source link

Matching Body with multipart/form-data #144

Open tamlyn opened 6 years ago

tamlyn commented 6 years ago

When POSTing with mutlipart/form-data the body and Content-type header contain a randomly generated boundary property:

POST /api/auth/sign_in
host: api.example.com
content-type: multipart/form-data; boundary=--------------------------638137267150259757037725
body: ----------------------------638137267150259757037725\r\nContent-Disposition: form-data; name=\"email\"\r\n\r\nuser@example.com\r\n----------------------------638137267150259757037725\r\nContent-Disposition: form-data; name=\"password\"\r\n\r\nfoobar\r\n----------------------------638137267150259757037725--\r\n

This prevents subsequent requests from matching the pre-recorded response. Anyone have a solution for this (other than not matching on body and content-type)?