From 8c664a13967ee566735fb2f1b566531da2dfc943 Mon Sep 17 00:00:00 2001 From: fef Date: Mon, 12 Dec 2022 18:59:57 +0100 Subject: [PATCH] fix 404 when reacting with Keycap Number Sign The Unicode sequence for the Keycap Number Sign emoji starts with an ASCII "#" character, which the browser's URL parser will interpret as a URI fragment and truncate it before sending the request to the backend. --- src/services/api/api.service.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js index 9e6f39f2..3edda6e1 100644 --- a/src/services/api/api.service.js +++ b/src/services/api/api.service.js @@ -1335,7 +1335,7 @@ const fetchEmojiReactions = ({ id, credentials }) => { const reactWithEmoji = ({ id, emoji, credentials }) => { return promisedRequest({ - url: PLEROMA_EMOJI_REACT_URL(id, emoji), + url: PLEROMA_EMOJI_REACT_URL(id, encodeURIComponent(emoji)), method: 'PUT', credentials }).then(parseStatus) @@ -1343,7 +1343,7 @@ const reactWithEmoji = ({ id, emoji, credentials }) => { const unreactWithEmoji = ({ id, emoji, credentials }) => { return promisedRequest({ - url: PLEROMA_EMOJI_UNREACT_URL(id, emoji), + url: PLEROMA_EMOJI_UNREACT_URL(id, encodeURIComponent(emoji)), method: 'DELETE', credentials }).then(parseStatus)