1
0
Fork 0
forked from srxl/akkoma-fe

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.
This commit is contained in:
anna 2022-12-12 18:59:57 +01:00
parent 9bf310d509
commit 413acbc7dd
Signed by untrusted user: fef
GPG key ID: EC22E476DC2D3D84

View file

@ -1335,7 +1335,7 @@ const fetchEmojiReactions = ({ id, credentials }) => {
const reactWithEmoji = ({ id, emoji, credentials }) => { const reactWithEmoji = ({ id, emoji, credentials }) => {
return promisedRequest({ return promisedRequest({
url: PLEROMA_EMOJI_REACT_URL(id, emoji), url: PLEROMA_EMOJI_REACT_URL(id, encodeURIComponent(emoji)),
method: 'PUT', method: 'PUT',
credentials credentials
}).then(parseStatus) }).then(parseStatus)
@ -1343,7 +1343,7 @@ const reactWithEmoji = ({ id, emoji, credentials }) => {
const unreactWithEmoji = ({ id, emoji, credentials }) => { const unreactWithEmoji = ({ id, emoji, credentials }) => {
return promisedRequest({ return promisedRequest({
url: PLEROMA_EMOJI_UNREACT_URL(id, emoji), url: PLEROMA_EMOJI_UNREACT_URL(id, encodeURIComponent(emoji)),
method: 'DELETE', method: 'DELETE',
credentials credentials
}).then(parseStatus) }).then(parseStatus)