diff options
author | Vitaly Takmazov | 2018-10-04 19:06:18 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2018-10-04 19:06:18 +0300 |
commit | 9848227c11f3cc4c0ccf6e01d0185c5fda506e80 (patch) | |
tree | f529b0c79fa55346bce231b4f28b17157663d518 /juick-server | |
parent | 41884ff2f4f19a4b2a05a3bbe4b8e6c0043fd9d9 (diff) |
fixes found in tests
Diffstat (limited to 'juick-server')
-rw-r--r-- | juick-server/src/main/java/com/juick/server/api/Service.java | 10 | ||||
-rw-r--r-- | juick-server/src/main/java/com/juick/server/api/activity/Profile.java | 6 |
2 files changed, 9 insertions, 7 deletions
diff --git a/juick-server/src/main/java/com/juick/server/api/Service.java b/juick-server/src/main/java/com/juick/server/api/Service.java index c612d3bf..41f05f97 100644 --- a/juick-server/src/main/java/com/juick/server/api/Service.java +++ b/juick-server/src/main/java/com/juick/server/api/Service.java @@ -59,10 +59,12 @@ public class Service { public void processMail(InputStream data) throws Exception { if (UserUtils.getCurrentUser().getName().equals(serviceUser)) { MimeMessage msg = new MimeMessage(session, data); - String returnPath = msg.getHeader("Return-Path")[0]; - logger.info("got msg with return path {}", returnPath); - if (returnPath.equals("<>")) { - return; + String[] returnPaths = msg.getHeader("Return-Path"); + if (returnPaths != null) { + logger.info("got msg with return path {}", returnPaths[0]); + if (returnPaths[0].equals("<>")) { + return; + } } String from = msg.getFrom() == null || msg.getFrom().length > 1 ? ((InternetAddress) msg.getSender()).getAddress() : ((InternetAddress) msg.getFrom()[0]).getAddress(); diff --git a/juick-server/src/main/java/com/juick/server/api/activity/Profile.java b/juick-server/src/main/java/com/juick/server/api/activity/Profile.java index a46db7fe..6fdd9d8c 100644 --- a/juick-server/src/main/java/com/juick/server/api/activity/Profile.java +++ b/juick-server/src/main/java/com/juick/server/api/activity/Profile.java @@ -231,10 +231,10 @@ public class Profile { public ResponseEntity<Void> processInbox(@RequestBody Activity activity, @RequestHeader(name = "Host") String host, @RequestHeader(name = "Date") String date, - @RequestHeader(name = "Digest") String digest, + @RequestHeader(name = "Digest", required = false) String digest, @RequestHeader(name = "Content-Type") String contentType, - @RequestHeader(name = "User-Agent") String userAgent, - @RequestHeader(name = "Signature") String signature) { + @RequestHeader(name = "User-Agent", required = false) String userAgent, + @RequestHeader(name = "Signature", required = false) String signature) { UriComponents componentsBuilder = ServletUriComponentsBuilder.fromCurrentRequestUri().build(); Map<String, String> headers = new HashMap<>(); headers.put("host", host); |