From ccc8c04782e57a66f04c268c844bdbb8f91eb877 Mon Sep 17 00:00:00 2001
From: zzz <zzz@mail.i2p>
Date: Mon, 28 Sep 2015 14:52:55 +0000
Subject: [PATCH] i2psnark: Support adding plain base 32 hashes convert plain
 hashes to upper case

---
 .../java/src/org/klomp/snark/web/I2PSnarkServlet.java       | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java b/apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java
index 72ea2ecadf..fdd70c0d9d 100644
--- a/apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java
+++ b/apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java
@@ -981,6 +981,12 @@ public class I2PSnarkServlet extends BasicServlet {
                 } else if (newURL.startsWith(MagnetURI.MAGNET) || newURL.startsWith(MagnetURI.MAGGOT)) {
                     addMagnet(newURL, dir);
                 } else if (newURL.length() == 40 && newURL.replaceAll("[a-fA-F0-9]", "").length() == 0) {
+                    // hex
+                    newURL = newURL.toUpperCase(Locale.US);
+                    addMagnet(MagnetURI.MAGNET_FULL + newURL, dir);
+                } else if (newURL.length() == 32 && newURL.replaceAll("[a-zA-Z2-7]", "").length() == 0) {
+                    // b32
+                    newURL = newURL.toUpperCase(Locale.US);
                     addMagnet(MagnetURI.MAGNET_FULL + newURL, dir);
                 } else {
                     _manager.addMessage(_t("Invalid URL: Must start with \"http://\", \"{0}\", or \"{1}\"",
-- 
GitLab