Set latest edition on the insert URI, too.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sun, 28 Sep 2014 11:57:19 +0000 (13:57 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sun, 28 Sep 2014 11:57:19 +0000 (13:57 +0200)
This should prevent ridiculously large editions when creating insert
keys from the identity keys.

src/main/java/net/pterodactylus/sone/data/SoneImpl.java

index 86c5935..341746b 100644 (file)
@@ -190,7 +190,10 @@ public class SoneImpl implements Sone {
                        return null;
                }
                try {
-                       return new FreenetURI(((OwnIdentity) getIdentity()).getInsertUri()).setDocName("Sone").setMetaString(new String[0]);
+                       return new FreenetURI(((OwnIdentity) getIdentity()).getInsertUri())
+                                       .setDocName("Sone")
+                                       .setMetaString(new String[0])
+                                       .setSuggestedEdition(latestEdition);
                } catch (MalformedURLException e) {
                        throw new IllegalStateException(format("Own identity %s's insert URI is incorrect.", getIdentity()), e);
                }