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> {
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,
});

View file

@ -220,7 +220,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // 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, */*',