From 929e0c8c36c56a0f8028b4f7e1d4f9a97f50bb1a Mon Sep 17 00:00:00 2001 From: sy Date: Sat, 1 Apr 2023 01:50:45 +0800 Subject: [PATCH] fix: encodeURIComponent webmention API target --- components/WebMention.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/WebMention.js b/components/WebMention.js index c993fe22..62896ce1 100644 --- a/components/WebMention.js +++ b/components/WebMention.js @@ -80,7 +80,7 @@ const WebmentionReplies = ({ target }) => { const [mentions, setMentions] = useState([]) const fetchMentions = async (target) => fetch( - `https://webmention.io/api/mentions.jf2?per-page=500&target=${target}&token=${BLOG.COMMENT_WEBMENTION.TOKEN}` + `https://webmention.io/api/mentions.jf2?per-page=500&target=${encodeURIComponent(target)}&token=${BLOG.COMMENT_WEBMENTION.TOKEN}` ).then((response) => (response.json ? response.json() : response)) useEffect(() => { async function getMentions() {