Permalink
Browse files

Adds additional error checking.

  • Loading branch information...
1 parent 257e43b commit afcdf6efb389389031e0a9286c57ae3e2f8e9809 @AArnott AArnott committed Mar 25, 2013
Showing with 2 additions and 0 deletions.
  1. +2 −0 src/DotNetOpenAuth.OpenId/OpenId/XriDiscoveryProxyService.cs
@@ -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));

0 comments on commit afcdf6e

Please sign in to comment.