fix(backend): HttpRequestService.sendでURLをデコードしてからリクエストを送信するように

HttpRequestService側で処理するように変更しました。意図していたものとは異なる可能性もありますが...
This commit is contained in:
AmaseCocoa 2024-11-21 22:54:31 +09:00
parent c488ba03b7
commit e9ee83fccd
2 changed files with 3 additions and 2 deletions

View File

@ -283,6 +283,7 @@ export class HttpRequestService {
}, },
): Promise<Response> { ): Promise<Response> {
const timeout = args.timeout ?? 5000; const timeout = args.timeout ?? 5000;
const decodedUrl = decodeURIComponent(url);
const controller = new AbortController(); const controller = new AbortController();
setTimeout(() => { setTimeout(() => {
@ -299,7 +300,7 @@ export class HttpRequestService {
}, },
body: args.body, body: args.body,
size: args.size ?? 10 * 1024 * 1024, size: args.size ?? 10 * 1024 * 1024,
agent: (url) => this.getAgentByUrl(url, false, isLocalAddressAllowed), agent: (decodedUrl) => this.getAgentByUrl(decodedUrl, false, isLocalAddressAllowed),
signal: controller.signal, signal: controller.signal,
}); });

View File

@ -220,7 +220,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
private httpRequestService: HttpRequestService, private httpRequestService: HttpRequestService,
) { ) {
super(meta, paramDef, async (ps, me) => { 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', method: 'GET',
headers: { headers: {
Accept: 'application/rss+xml, */*', Accept: 'application/rss+xml, */*',