extend/cowboy — pull request #561 by danielwhite (2013-07-16 10:27:28+00:00)
Title: Do not crash if Basic authorization credentials are invalid base64

base64:mime_decode/1 will raise an error if the provided binary does
not contain a properly encoded base64 string. This handles the
failure to ensure that cowboy_http:authorization/2 will return
{error, badarg} as expected rather than raising an error.

base64_string/2 is able to completely substitute for
cowboy_http:whitespace/2 due to base64:mime_decode/1 stripping
whitespace.