diff options
author | Vitaly Takmazov | 2017-09-27 15:19:06 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2017-09-28 12:54:39 +0300 |
commit | 751b2a9b0fc523d17c9f7a410fadcc82eaaa1fb7 (patch) | |
tree | 1be25ccef6d38b4ec45084e389aed3045c1cdd70 /juick-server-web/src/main/java/com/juick/server/util | |
parent | e6e25791d6b9c8360247d92340b0dccda33c86ed (diff) |
api: Telegram posting
Diffstat (limited to 'juick-server-web/src/main/java/com/juick/server/util')
-rw-r--r-- | juick-server-web/src/main/java/com/juick/server/util/HttpUtils.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/juick-server-web/src/main/java/com/juick/server/util/HttpUtils.java b/juick-server-web/src/main/java/com/juick/server/util/HttpUtils.java index 971587a8..db920e88 100644 --- a/juick-server-web/src/main/java/com/juick/server/util/HttpUtils.java +++ b/juick-server-web/src/main/java/com/juick/server/util/HttpUtils.java @@ -77,8 +77,12 @@ public class HttpUtils { attachmentType = "jpg"; } else if (mime != null && mime.equals("image/png")) { attachmentType = "png"; + } else if (url.getFile().toLowerCase().endsWith("jpg")) { + attachmentType = "jpg"; + } else if (url.getFile().toLowerCase().endsWith("png")) { + attachmentType = "png"; } else { - throw new Exception("Wrong file type"); + throw new Exception("Wrong file type: " + mime); } attachmentFName = DigestUtils.md5Hex(UUID.randomUUID().toString()) + "." + attachmentType; |