diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2012-05-31 19:10:29 -0700 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2012-05-31 19:10:29 -0700 |
commit | ad853eb657990929705ae154f046a3d50b3b31e1 (patch) | |
tree | 1f42cf39efdf06512f7961052a0e98323304753d /src/DotNetOpenAuth.AspNet/Clients/OAuth/TwitterClient.cs | |
parent | 5e07054db57c7d52ca9e3d05ff16c4321eb514b7 (diff) | |
parent | 109188abee3772791dda97e7cbe36b3dc820f5fb (diff) | |
download | DotNetOpenAuth-ad853eb657990929705ae154f046a3d50b3b31e1.zip DotNetOpenAuth-ad853eb657990929705ae154f046a3d50b3b31e1.tar.gz DotNetOpenAuth-ad853eb657990929705ae154f046a3d50b3b31e1.tar.bz2 |
Merge remote-tracking branch 'levi/codereview' into v4.0
Diffstat (limited to 'src/DotNetOpenAuth.AspNet/Clients/OAuth/TwitterClient.cs')
-rw-r--r-- | src/DotNetOpenAuth.AspNet/Clients/OAuth/TwitterClient.cs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/DotNetOpenAuth.AspNet/Clients/OAuth/TwitterClient.cs b/src/DotNetOpenAuth.AspNet/Clients/OAuth/TwitterClient.cs index 96c1701..886917a 100644 --- a/src/DotNetOpenAuth.AspNet/Clients/OAuth/TwitterClient.cs +++ b/src/DotNetOpenAuth.AspNet/Clients/OAuth/TwitterClient.cs @@ -92,7 +92,7 @@ namespace DotNetOpenAuth.AspNet.Clients { string userId = response.ExtraData["user_id"]; string userName = response.ExtraData["screen_name"]; - var profileRequestUrl = new Uri("http://api.twitter.com/1/users/show.xml?user_id=" + var profileRequestUrl = new Uri("https://api.twitter.com/1/users/show.xml?user_id=" + MessagingUtilities.EscapeUriDataStringRfc3986(userId)); var profileEndpoint = new MessageReceivingEndpoint(profileRequestUrl, HttpDeliveryMethods.GetRequest); HttpWebRequest request = this.WebWorker.PrepareAuthorizedRequest(profileEndpoint, accessToken); @@ -102,14 +102,15 @@ namespace DotNetOpenAuth.AspNet.Clients { try { using (WebResponse profileResponse = request.GetResponse()) { using (Stream responseStream = profileResponse.GetResponseStream()) { - XDocument document = XDocument.Load(responseStream); + XDocument document = LoadXDocumentFromStream(responseStream); extraData.AddDataIfNotEmpty(document, "name"); extraData.AddDataIfNotEmpty(document, "location"); extraData.AddDataIfNotEmpty(document, "description"); extraData.AddDataIfNotEmpty(document, "url"); } } - } catch (Exception) { + } + catch (Exception) { // At this point, the authentication is already successful. // Here we are just trying to get additional data if we can. // If it fails, no problem. @@ -121,4 +122,4 @@ namespace DotNetOpenAuth.AspNet.Clients { #endregion } -} +}
\ No newline at end of file |