From 3f339daa8f1e8e2ac39ed7388e9cae1d82507746 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Tue, 8 Jun 2021 02:19:10 +0300 Subject: Unescape Java literals in ActivityPub logs --- src/main/java/com/juick/www/api/activity/Profile.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/main/java/com') 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 d416e591..e261c2e8 100644 --- a/src/main/java/com/juick/www/api/activity/Profile.java +++ b/src/main/java/com/juick/www/api/activity/Profile.java @@ -51,6 +51,7 @@ import com.juick.service.security.annotation.Visitor; import com.overzealous.remark.Remark; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.StringUtils; +import org.apache.commons.text.StringEscapeUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; @@ -281,7 +282,7 @@ public class Profile { Context.ACTIVITYSTREAMS_PROFILE_MEDIA_TYPE }) public ResponseEntity processInbox(@Visitor User visitor, InputStream inboxData) throws Exception { String inbox = IOUtils.toString(inboxData, StandardCharsets.UTF_8); - logger.info("Inbox: {}", inbox); + logger.info("Inbox: {}", StringEscapeUtils.unescapeJava(inbox)); Activity activity = jsonMapper.readValue(inbox, Activity.class); if ((StringUtils.isNotEmpty(visitor.getUri().toString()) && visitor.getUri().equals(URI.create(activity.getActor()))) || !visitor.isAnonymous()) { -- cgit v1.2.3