Fixing the "this cannot include CR/LF" error when doing Basic auth in Ruby
Sometimes, opting for sensible defaults seems obvious. Yet, sometimes, the default and most obvious option isn't the most sensible.
Today, while testing an integration I'm currently working on for a client, I got the following error:
class: ArgumentError
message: header Authorization has field value "Basic somethingSomethingBase64Encoded", this cannot include CR/LF
This meant that my Authorization
header was considered to be invalid, because it supposedly contained a new line character at the end, even though I certainly didn't recall adding any such thing when creating it.