From e9ee83fccd7944ad764063aea30e27366da5160b Mon Sep 17 00:00:00 2001 From: AmaseCocoa Date: Thu, 21 Nov 2024 22:54:31 +0900 Subject: [PATCH] =?UTF-8?q?fix(backend):=20HttpRequestService.send?= =?UTF-8?q?=E3=81=A7URL=E3=82=92=E3=83=87=E3=82=B3=E3=83=BC=E3=83=89?= =?UTF-8?q?=E3=81=97=E3=81=A6=E3=81=8B=E3=82=89=E3=83=AA=E3=82=AF=E3=82=A8?= =?UTF-8?q?=E3=82=B9=E3=83=88=E3=82=92=E9=80=81=E4=BF=A1=E3=81=99=E3=82=8B?= =?UTF-8?q?=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit HttpRequestService側で処理するように変更しました。意図していたものとは異なる可能性もありますが... --- packages/backend/src/core/HttpRequestService.ts | 3 ++- packages/backend/src/server/api/endpoints/fetch-rss.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/core/HttpRequestService.ts b/packages/backend/src/core/HttpRequestService.ts index 083153940a..0a23202381 100644 --- a/packages/backend/src/core/HttpRequestService.ts +++ b/packages/backend/src/core/HttpRequestService.ts @@ -283,6 +283,7 @@ export class HttpRequestService { }, ): Promise { const timeout = args.timeout ?? 5000; + const decodedUrl = decodeURIComponent(url); const controller = new AbortController(); setTimeout(() => { @@ -299,7 +300,7 @@ export class HttpRequestService { }, body: args.body, size: args.size ?? 10 * 1024 * 1024, - agent: (url) => this.getAgentByUrl(url, false, isLocalAddressAllowed), + agent: (decodedUrl) => this.getAgentByUrl(decodedUrl, false, isLocalAddressAllowed), signal: controller.signal, }); diff --git a/packages/backend/src/server/api/endpoints/fetch-rss.ts b/packages/backend/src/server/api/endpoints/fetch-rss.ts index ae6ad1b9dc..562092ea07 100644 --- a/packages/backend/src/server/api/endpoints/fetch-rss.ts +++ b/packages/backend/src/server/api/endpoints/fetch-rss.ts @@ -220,7 +220,7 @@ export default class extends Endpoint { // eslint- private httpRequestService: HttpRequestService, ) { super(meta, paramDef, async (ps, me) => { - const res = await this.httpRequestService.send(decodeURIComponent(ps.url), { + const res = await this.httpRequestService.send(ps.url, { method: 'GET', headers: { Accept: 'application/rss+xml, */*',