Skip to content
This repository has been archived by the owner on Mar 20, 2019. It is now read-only.

Commit

Permalink
Adds additional error checking.
Browse files Browse the repository at this point in the history
  • Loading branch information
AArnott committed Mar 25, 2013
1 parent 257e43b commit afcdf6e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/DotNetOpenAuth.OpenId/OpenId/XriDiscoveryProxyService.cs
Expand Up @@ -92,7 +92,9 @@ public class XriDiscoveryProxyService : IIdentifierDiscoveryService, IRequireHos

XrdsDocument doc;
using (var xrdsResponse = await Yadis.RequestAsync(GetXrdsUrl(identifier), identifier.IsDiscoverySecureEndToEnd, hostFactories, cancellationToken)) {
xrdsResponse.EnsureSuccessStatusCode();
var readerSettings = MessagingUtilities.CreateUntrustedXmlReaderSettings();
ErrorUtilities.VerifyProtocol(xrdsResponse.Content != null, "XRDS request \"{0}\" returned no response.", GetXrdsUrl(identifier));
await xrdsResponse.Content.LoadIntoBufferAsync();
using (var xrdsStream = await xrdsResponse.Content.ReadAsStreamAsync()) {
doc = new XrdsDocument(XmlReader.Create(xrdsStream, readerSettings));
Expand Down

0 comments on commit afcdf6e

Please sign in to comment.