Skip to content

Commit

Permalink
Words.
Browse files Browse the repository at this point in the history
  • Loading branch information
myronmarston committed Feb 22, 2012
1 parent da23955 commit 994a236
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -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)
Expand Down
23 changes: 23 additions & 0 deletions Upgrade.md
Expand Up @@ -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.