Howdy,

With the attached patch applied, if a channel's URL contains a user
name and password, Blam will use them for HTTP authentication.  This
doesn't prompt the user when the server requests HTTP authentication
and a user name and password aren't included in the URL, but it's a
step forward.

-- 
Matt
--- blam-1.8.2.orig/src/FeedUpdater.cs
+++ blam-1.8.2/src/FeedUpdater.cs
@@ -117,6 +117,20 @@
 
            try {
                req = (HttpWebRequest) WebRequest.Create(channel.Url);
+               Uri uri = new Uri(channel.Url, true);
+
+               if (uri.UserInfo != "") {
+                   int i = 0;
+                   string userName = "";
+                   while (uri.UserInfo[i] != ':')
+                       userName += Uri.HexUnescape(uri.UserInfo, ref i);
+                   i += 1;
+                   string password = "";
+                   while (i < uri.UserInfo.Length)
+                       password += Uri.HexUnescape(uri.UserInfo, ref i);
+                   req.Credentials = new NetworkCredential(userName,
+                                                           password);
+               }
 
                if (channel.LastModified != "") {
                    req.IfModifiedSince = DateTime.Parse(channel.LastModified);

Attachment: signature.asc
Description: Digital signature

Reply via email to