fixed url parsing
This commit is contained in:
parent
da822ebae8
commit
f45a841caf
|
@ -383,7 +383,12 @@ public class Message extends AbstractEntity {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
String[] pathParts = url.getPath().split("/");
|
String[] pathParts = url.getPath().split("/");
|
||||||
String filename = pathParts[pathParts.length - 1];
|
String filename;
|
||||||
|
if (pathParts.length > 0) {
|
||||||
|
filename = pathParts[pathParts.length - 1];
|
||||||
|
} else {
|
||||||
|
filename = pathParts[0];
|
||||||
|
}
|
||||||
String[] extensionParts = filename.split("\\.");
|
String[] extensionParts = filename.split("\\.");
|
||||||
if (extensionParts.length == 2
|
if (extensionParts.length == 2
|
||||||
&& Arrays.asList(Downloadable.VALID_EXTENSIONS).contains(
|
&& Arrays.asList(Downloadable.VALID_EXTENSIONS).contains(
|
||||||
|
|
Loading…
Reference in New Issue