Convert the URI a Sone was downloaded from to USK before setting it.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 17 Nov 2010 12:45:08 +0000 (13:45 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 17 Nov 2010 12:45:08 +0000 (13:45 +0100)
src/main/java/net/pterodactylus/sone/core/SoneDownloader.java

index 42f6702..2310aca 100644 (file)
@@ -155,7 +155,11 @@ public class SoneDownloader extends AbstractService {
                        soneInputStream = soneBucket.getInputStream();
                        Sone parsedSone = parseSone(originalSone, soneInputStream);
                        if (parsedSone != null) {
-                               parsedSone.setRequestUri(requestUri.setMetaString(new String[0]));
+                               if (requestUri.getKeyType().equals("USK")) {
+                                       parsedSone.setRequestUri(requestUri.setMetaString(new String[0]));
+                               } else {
+                                       parsedSone.setRequestUri(requestUri.setKeyType("USK").setDocName("Sone").setMetaString(new String[0]));
+                               }
                        }
                        return parsedSone;
                } catch (IOException ioe1) {