-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Normalizes request body and URL by parsing params to a list and sorti…
…ng (#211) * Normalizes request body by parsing as params, then converting to a list Before this change, if the request body was a list of params that were in a different order than the params in the cassette, the request body match would fail. As of OTP 26, map key order is not guaranteed, so request bodies that are created using maps can fail to match since the order of their keys is not idempotent. These changes convert the request body to a list of params and sort it before comparing it to the request body in the cassette. This ensures cassettes will be matched as long as their request bodies contain the same set of key-value pairs as the incoming request body. * Normalizes url by parsing params, converting to a list, and sorting Before this change, if the url query params were in a different order than the url params in the cassette, the request body match would fail. As of OTP 26, map key order is not guaranteed, so url params that are created using maps can fail to match since the order of their keys is not idempotent. These changes convert the url params to a list and sort it before comparing it to the url in the cassette. This ensures cassettes will be matched as long as their url params contain the same set of key-value pairs as the incoming url params (and the rest of the url matches too).
- Loading branch information
1 parent
406af2d
commit d1c1765
Showing
6 changed files
with
61 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters