From b64b32d7a88b9449423ee9e5efed91dadc24d6c9 Mon Sep 17 00:00:00 2001 From: dirdi Date: Tue, 9 Sep 2014 03:10:08 +0200 Subject: [PATCH] Bugfix: Long username-password-combinations will not result in an authentication error anymore. If a username-password-combination is too long, perl's encode_base64 method will break the encoded string (stored in $auth) up into multiple lines of no more than 74 chars[0]. This breaks HTTP's authorization, since long values must not be folded into multiple lines[1]. [0] http://perldoc.perl.org/MIME/Base64.html [1] http://tools.ietf.org/html/rfc7230#section-3.2.4 --- ddclient | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ddclient b/ddclient index 9b1c8a9..319f053 100755 --- a/ddclient +++ b/ddclient @@ -1875,7 +1875,7 @@ sub geturl { $request .= "/$url HTTP/1.0\n"; $request .= "Host: $server\n"; - my $auth = encode_base64("${login}:${password}"); + my $auth = encode_base64("${login}:${password}", ""); $request .= "Authorization: Basic $auth\n" if $login || $password; $request .= "User-Agent: ${program}/${version}\n"; $request .= "Connection: close\n";