anunnakian / openid4java

Automatically exported from code.google.com/p/openid4java
Apache License 2.0
0 stars 0 forks source link

Yadis document parsing fails with empty <URI> element #43

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I know that strictly a Yadis document shouldn't have an empty <URI> 
element. However, poorly formed documents do exist so I suggest skipping a 
service with an empty URI rather than failing altogether as it does at the 
moment. This is the approach currently taken if the contents of a URI are 
malformed.

Here's a patch to make it skip empty URI elements:

Index: 
C:/Users/tlocke/workspace/openid4java/src/org/openid4java/discovery/Discove
ry.java
===================================================================
--- 
C:/Users/tlocke/workspace/openid4java/src/org/openid4java/discovery/Discove
ry.java (revision 411)
+++ 
C:/Users/tlocke/workspace/openid4java/src/org/openid4java/discovery/Discove
ry.java (working copy)
@@ -322,6 +322,9 @@
                 } catch (MalformedURLException e)
                 {
                     continue;
+                } catch (IllegalArgumentException e)
+                {
+                   continue;
                 }

                 if (matchType(service, DiscoveryInformation.OPENID2_OP))

Original issue reported on code.google.com by tlocke...@yahoo.co.uk on 10 Nov 2007 at 3:11

GoogleCodeExporter commented 9 years ago
Fixed in rev419. Thanks Tony!

Original comment by Johnny.B...@gmail.com on 21 Nov 2007 at 2:53