Subject: | Make header safe when using with clients other than LWP/Mech |
Finance::MtGox::_build_api_method_request creates an invalid HTTP header.
Because Rest-Sign is the result of a a regular base64-encoding, it
usually contains embedded newlines, which are invalid in headers.
LWP::Protocol::http takes care of that by replacing newlines with
spaces, but if a user wants to use the internal method to construct an
HTTP::Request to use with a different HTTP client, it will not work,
because most other clients don't perform this non-standard cleanup.
Finance::MtGox should itself replace the newlines with spaces. A
possible alternative is to use MIME::Base64::encode_base64url instead of
MIME::Base64::encode_base64, though I haven't tested that.