aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/www/api/activity
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2021-06-08 02:19:10 +0300
committerGravatar Vitaly Takmazov2021-06-08 02:19:10 +0300
commit3f339daa8f1e8e2ac39ed7388e9cae1d82507746 (patch)
tree3fa12b6a89ef0c7cb0f2c5e43a85a6af722b61de /src/main/java/com/juick/www/api/activity
parent6fc3e210072b90a29373c61df56513f718aefb0c (diff)
Unescape Java literals in ActivityPub logs
Diffstat (limited to 'src/main/java/com/juick/www/api/activity')
-rw-r--r--src/main/java/com/juick/www/api/activity/Profile.java3
1 files changed, 2 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 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<CommandResult> 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()) {