From fe4fbafcf0846f100a1614a47a20fb1bbbcf58da Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 17 Jan 2023 15:58:12 +0900 Subject: [PATCH] =?UTF-8?q?=E5=AD=98=E5=9C=A8=E3=81=97=E3=81=AA=E3=81=84?= =?UTF-8?q?=E3=82=AB=E3=82=B9=E3=82=BF=E3=83=A0=E7=B5=B5=E6=96=87=E5=AD=97?= =?UTF-8?q?=E3=82=92=E3=83=86=E3=82=AD=E3=82=B9=E3=83=88=E3=81=A7=E8=A1=A8?= =?UTF-8?q?=E7=A4=BA=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Resolve #9516 --- CHANGELOG.md | 1 + packages/backend/src/server/ServerService.ts | 9 +++++++-- packages/frontend/src/components/global/MkEmoji.vue | 4 +++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 56b25eae2..c877be07b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ You should also include the user name that made the change. ## 13.x.x (unreleased) ### Improvements +- 存在しないカスタム絵文字をテキストで表示するように ### Bugfixes - playを削除する手段がなかったのを修正 diff --git a/packages/backend/src/server/ServerService.ts b/packages/backend/src/server/ServerService.ts index fac8497b5..47d11ed0a 100644 --- a/packages/backend/src/server/ServerService.ts +++ b/packages/backend/src/server/ServerService.ts @@ -14,6 +14,7 @@ import { genIdenticon } from '@/misc/gen-identicon.js'; import { createTemp } from '@/misc/create-temp.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; import { LoggerService } from '@/core/LoggerService.js'; +import { bindThis } from '@/decorators.js'; import { ActivityPubServerService } from './ActivityPubServerService.js'; import { NodeinfoServerService } from './NodeinfoServerService.js'; import { ApiServerService } from './api/ApiServerService.js'; @@ -22,7 +23,6 @@ import { WellKnownServerService } from './WellKnownServerService.js'; import { MediaProxyServerService } from './MediaProxyServerService.js'; import { FileServerService } from './FileServerService.js'; import { ClientServerService } from './web/ClientServerService.js'; -import { bindThis } from '@/decorators.js'; @Injectable() export class ServerService { @@ -101,7 +101,12 @@ export class ServerService { reply.header('Content-Security-Policy', 'default-src \'none\'; style-src \'unsafe-inline\''); if (emoji == null) { - return await reply.redirect('/static-assets/emoji-unknown.png'); + if ('fallback' in request.query) { + return await reply.redirect('/static-assets/emoji-unknown.png'); + } else { + reply.code(404); + return; + } } const url = new URL('/proxy/emoji.webp', this.config.url); diff --git a/packages/frontend/src/components/global/MkEmoji.vue b/packages/frontend/src/components/global/MkEmoji.vue index bc88cf3be..b7dd0296c 100644 --- a/packages/frontend/src/components/global/MkEmoji.vue +++ b/packages/frontend/src/components/global/MkEmoji.vue @@ -1,5 +1,6 @@