Skip to content
Browse files

Words.

  • Loading branch information...
1 parent da23955 commit 994a236026929a2af49808fad48467bc164847aa @myronmarston committed Feb 21, 2012
Showing with 30 additions and 0 deletions.
  1. +6 −0 CHANGELOG.md
  2. +1 −0 README.md
  3. +23 −0 Upgrade.md
View
6 CHANGELOG.md
@@ -22,6 +22,12 @@
* Add `debug_logger` config option. This can be used to
troubleshoot what VCR is doing.
* Update WebMock to version (1.8.0) that supports Excon stubbing.
+ * Store the encoding with the request & response bodies in the
+ serialized cassette.
+ * Add new `preserve_exact_body_bytes` option that base64 encodes the
+ request or response body in order to preserve the bytes exactly.
+ Thanks to [Jeff Pollard](https://github.com/Fluxx) for help
+ designing this feature and for code reviewing it.
## Bug Fixes
View
1 README.md
@@ -133,6 +133,7 @@ Thanks also to the following people who have contributed patches or helpful sugg
* [Carlos Kirkconnell](https://github.com/kirkconnell)
* [Eric Allam](http://github.com/rubymaverick)
* [Flaviu Simihaian](https://github.com/closedbracket)
+* [Jeff Pollard](https://github.com/Fluxx)
* [Justin Smestad](https://github.com/jsmestad)
* [Karl Baum](https://github.com/kbaum)
* [Michael Lavrisha](https://github.com/vrish88)
View
23 Upgrade.md
@@ -220,3 +220,26 @@ the philosophy of VCR to record the entire sequence of HTTP interactions
interaction can only be played back once unless you use the new
`:allow_playback_repeats` option.
+## Preserve Exact Body Bytes
+
+Sometimes the request or response body of an HTTP interaction cannot
+be serialized and deserialized properly. Usually this is due to the body
+having invalid UTF-8 bytes. This new option configures VCR to base64
+encode the body in order to preserve the bytes exactly. It can either
+be configured globally with a block, or set on individual cassettes:
+
+``` ruby
+VCR.configure do |c|
+ c.preserve_exact_body_bytes do |http_message|
+ http_message.body.encoding.name == 'ASCII-8BIT' ||
+ !http_message.body.valid_encoding?
+ end
+end
+
+# or....
+
+VCR.use_cassette("my_cassette", :preserve_exact_body_bytes => true) do
+ # ...
+end
+```
+

0 comments on commit 994a236

Please sign in to comment.
Something went wrong with that request. Please try again.