puppetlabs/marionette-collective — pull request #211 by richardc (2014-07-23 11:16:12+00:00)
Title: MCO-293 check for correct-looking base64

The default Base64.decode method is very accepting, and will ignore
any characters not of the base64 character set, and decode those
that it does handle. This can lead to unfortunate error messages
in the case where the message was not base64 encoded to begin with,
but a connector may be configured to expect them, so it attempts
to decode what bits it can from a message body, yeilding something
that's just the base64-decodable portions of the input string, which
will typically choke a higher level deserialiser.

Here we reject any 'base64' messages that contain characters that
aren't in the base64 character set or whitespace, in order to raise
an error sooner.