local-ch / lhc

🚀 Advanced HTTP Client for Ruby. Fueled with interceptors.
GNU General Public License v3.0
43 stars 1 forks source link

Using long credentials creates invalid authorization header #173

Closed JochenLutz closed 4 years ago

JochenLutz commented 4 years ago

I added authentication to my application with LHC::Auth.

My username is 15 characters long, the password has 32 characters. This results in an invalid authorization header, as Ruby's Base64#encode64 adds newlines after every 60 encoded characters (see Ruby doc).

[...]
Accept-Charset: utf-8
Authorization: Basic XXXXxxxxXXXXxxxxXXXXxxxxXXXXxxxxXXXXxxxxXXXXxxxxXXXXxxxxXXXX
xxxx
[...]

Using Base64::strict_encode64 should fix this issue.

10xSebastian commented 4 years ago

Addressed in https://github.com/local-ch/lhc/pull/179

Once reviewed I will release it as 12.0.3

Let me know if you should need a backport.

Thanks for reporting.

10xSebastian commented 4 years ago

https://github.com/local-ch/lhc/releases/tag/v12.0.3