Author: gonzalo
Date: 2006-10-05 10:14:52 -0400 (Thu, 05 Oct 2006)
New Revision: 66288

Modified:
   trunk/google-sharp/ChangeLog
   trunk/google-sharp/src/Mono.Google/Authentication.cs
Log:
2006-10-05 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>

        * src/Mono.Google/Authentication.cs: make the captcha_url relative to
        the url given in the error response.



Modified: trunk/google-sharp/ChangeLog
===================================================================
--- trunk/google-sharp/ChangeLog        2006-10-05 14:00:29 UTC (rev 66287)
+++ trunk/google-sharp/ChangeLog        2006-10-05 14:14:52 UTC (rev 66288)
@@ -1,5 +1,10 @@
 2006-10-05 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
 
+       * src/Mono.Google/Authentication.cs: make the captcha_url relative to
+       the url given in the error response.
+
+2006-10-05 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
+
        * src/Mono.Google/AuthErrorCode.cs: removed.
        * src/Mono.Google/Authentication.cs:
        * src/Mono.Google/Makefile.am:

Modified: trunk/google-sharp/src/Mono.Google/Authentication.cs
===================================================================
--- trunk/google-sharp/src/Mono.Google/Authentication.cs        2006-10-05 
14:00:29 UTC (rev 66287)
+++ trunk/google-sharp/src/Mono.Google/Authentication.cs        2006-10-05 
14:14:52 UTC (rev 66288)
@@ -164,7 +164,7 @@
                                                        AccountDeleted,
                                                        AccountDisabled,
                                                        ServiceUnavailable
-                                                 but CaptchRequired is 
reported as 'cr'. Don't know about the others.
+                                                 but CaptchaRequired is 
reported as 'cr'. Don't know about the others.
                                                */
                                                code = str.Substring (6);
                                        } else if (str.StartsWith 
("CaptchaToken=")) {
@@ -174,8 +174,15 @@
                                        }
                                }
                        }
-                       if (code == "cr" && token != null && captcha_url != 
null)
+                       if (code == "cr" && token != null && captcha_url != 
null) {
+                               if (url != null) {
+                                       Uri uri = new Uri (url);
+                                       captcha_url = new Uri (uri, 
captcha_url).ToString ();
+                               } else if (!captcha_url.StartsWith 
("https://";)) {
+                                       captcha_url = 
"https://www.google.com/accounts/"; + captcha_url;
+                               }
                                throw new CaptchaException (url, token, 
captcha_url);
+                       }
 
                        throw new UnauthorizedAccessException (String.Format 
("Access to '{0}' is denied ({1})", url, code));
                }

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to