diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2012-06-10 18:12:31 -0700 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2012-06-10 18:12:31 -0700 |
commit | 4aa2ffd3206cd342282e6bf3e0a518a6d0f65529 (patch) | |
tree | 149114a89f4eeea76c9e1f5a0e2e0ef4f5c6d36d /src/DotNetOpenAuth.AspNet/Clients/OAuth/TwitterClient.cs | |
parent | f70166165c385afa52393bbe384f65c100ef94e5 (diff) | |
parent | 9ba6f876e55dfb12126081c57ae146cbe09ede53 (diff) | |
download | DotNetOpenAuth-4aa2ffd3206cd342282e6bf3e0a518a6d0f65529.zip DotNetOpenAuth-4aa2ffd3206cd342282e6bf3e0a518a6d0f65529.tar.gz DotNetOpenAuth-4aa2ffd3206cd342282e6bf3e0a518a6d0f65529.tar.bz2 |
Merge branch 'v4.0'
Conflicts:
projecttemplates/projecttemplates.proj
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 |