aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/main/java/com/juick/server/api
diff options
context:
space:
mode:
Diffstat (limited to 'juick-server/src/main/java/com/juick/server/api')
-rw-r--r--juick-server/src/main/java/com/juick/server/api/Service.java10
-rw-r--r--juick-server/src/main/java/com/juick/server/api/activity/Profile.java6
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 c612d3bff..41f05f972 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 a46db7fe2..6fdd9d8c6 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);