aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/www
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2023-02-16 01:35:48 +0300
committerGravatar Vitaly Takmazov2023-02-16 01:44:08 +0300
commit929db81f1fea5059f9661ba5fad3708c7d6b85e9 (patch)
treea6862c6e9690e51c8ac0b4f32efd692bdc840e19 /src/main/java/com/juick/www
parent1695469b2c2d0f72ef63ad72070a464e42b2086a (diff)
ActivityPub: improve logging
Diffstat (limited to 'src/main/java/com/juick/www')
-rw-r--r--src/main/java/com/juick/www/api/activity/Profile.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/com/juick/www/api/activity/Profile.java b/src/main/java/com/juick/www/api/activity/Profile.java
index 580ed340..f37ef6ff 100644
--- a/src/main/java/com/juick/www/api/activity/Profile.java
+++ b/src/main/java/com/juick/www/api/activity/Profile.java
@@ -279,8 +279,11 @@ public class Profile {
@CacheEvict(cacheNames = "profiles", key = "{ #visitor.uri }")
@PostMapping(value = "/api/inbox", consumes = { Context.LD_JSON_MEDIA_TYPE, Context.ACTIVITY_MEDIA_TYPE,
Context.ACTIVITYSTREAMS_PROFILE_MEDIA_TYPE, MediaType.APPLICATION_JSON_VALUE })
- public ResponseEntity<CommandResult> processInbox(@Parameter(hidden = true) User visitor, @RequestBody Context context)
+ public ResponseEntity<CommandResult> processInbox(@Parameter(hidden = true) User visitor, InputStream body)
throws Exception {
+ var inboxBody = IOUtils.toString(body, StandardCharsets.UTF_8);
+ logger.debug("Inbox: {}", inboxBody);
+ var context = jsonMapper.readValue(inboxBody, Context.class);
if (context instanceof Activity activity) {
if ((StringUtils.isNotEmpty(visitor.getUri().toString())
&& visitor.getUri().equals(URI.create(activity.getActor()))) || !visitor.isAnonymous()) {