i2psnark: Handle metainfo url-list as single byte string

This commit is contained in:
zzz
2023-11-15 13:40:30 -05:00
parent b1a403cbed
commit 60f817be63

View File

@@ -186,11 +186,20 @@ public class MetaInfo
if (val == null) {
this.url_list = null;
} else {
List<BEValue> bl1 = val.getList();
this.url_list = new ArrayList<String>(bl1.size());
for (BEValue bev : bl1) {
this.url_list.add(bev.getString());
List<String> urllist;
try {
List<BEValue> bl1 = val.getList();
urllist = new ArrayList<String>(bl1.size());
for (BEValue bev : bl1) {
urllist.add(bev.getString());
}
} catch (InvalidBEncodingException ibee) {
// BEP 19 says it's a list but the example there
// is for a single byte string, and we've seen this
// in the wild.
urllist = Collections.singletonList(val.getString());
}
this.url_list = urllist;
}
// misc. optional top-level stuff