savonrb/akami — pull request #17 by drn (2014-12-02 01:22:13+00:00)
Title: Signature signing should strip excessive whitespace.

TLDR: The commit removes pretty XML formatting when generating a SignatureValue.

Details: While our team was integrating with a third-party API, one of the issues that came up was the signature generated wasn't accepted by the API as being signed properly because it included additional whitespace when generating the SignatureValue. This is due to the default way Nokogiri outputs to xml. The `.to_s` call is equivalent to the `to_xml` call with the default options `Nokogiri::XML::Node::SaveOptions::DEFAULT_XML` where `DEFAULT_XML = FORMAT | AS_XML`.

The examples below illustrate the differences in encoding:
```xml
❯❯❯ 2.1.2 *::Nested_1 ❯ signature.instance_variable_get(:@document).to_xml(save_with: Nokogiri::XML::Node::SaveOptions::AS_XML)
=> "\nhttp://api.example.com/echohttps://api.example.comurn:uuid:52d12080-5bec-0132-62fb-38f6b11526bfExample\n"
❯❯❯ 2.1.2 *::Nested_1 ❯ signature.instance_variable_get(:@document).to_s
=> "\n\n \n http://api.example.com/echo\n https://api.example.com\n urn:uuid:52d12080-5bec-0132-62fb-38f6b11526bf\n \n \n Example\n \n\n"
```