Compare commits

...

7 Commits

Author SHA1 Message Date
甘瀬ここあ a3519afaaf
Merge 3a2922db6f into 752606fe88 2024-11-21 14:02:45 +00:00
AmaseCocoa 3a2922db6f fix(backend): HttpRequestService.tsの変更漏れを修正 (fetch時にデコード済みのurlを参照するように) 2024-11-21 23:02:36 +09:00
AmaseCocoa 545b1c043f Merge branch 'develop' of https://github.com/AmaseCocoa/misskey into develop 2024-11-21 22:54:36 +09:00
AmaseCocoa e9ee83fccd fix(backend): HttpRequestService.sendでURLをデコードしてからリクエストを送信するように
HttpRequestService側で処理するように変更しました。意図していたものとは異なる可能性もありますが...
2024-11-21 22:54:31 +09:00
甘瀬ここあ cd642cc791
Merge branch 'misskey-dev:develop' into develop 2024-11-21 22:53:09 +09:00
甘瀬ここあ c488ba03b7
Merge branch 'misskey-dev:develop' into develop 2024-11-21 15:51:00 +09:00
甘瀬ここあ edc8d70db0
fix(backend): URLをデコードしてからリクエストを送信するように 2024-11-21 15:45:31 +09:00
2 changed files with 4 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(() => {
@ -291,7 +292,7 @@ export class HttpRequestService {
const isLocalAddressAllowed = args.isLocalAddressAllowed ?? false; const isLocalAddressAllowed = args.isLocalAddressAllowed ?? false;
const res = await fetch(url, { const res = await fetch(decodedUrl, {
method: args.method ?? 'GET', method: args.method ?? 'GET',
headers: { headers: {
'User-Agent': this.config.userAgent, 'User-Agent': this.config.userAgent,
@ -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

@ -7,6 +7,7 @@ import Parser from 'rss-parser';
import { Injectable } from '@nestjs/common'; import { Injectable } from '@nestjs/common';
import { Endpoint } from '@/server/api/endpoint-base.js'; import { Endpoint } from '@/server/api/endpoint-base.js';
import { HttpRequestService } from '@/core/HttpRequestService.js'; import { HttpRequestService } from '@/core/HttpRequestService.js';
import { URL } from 'url';
const rssParser = new Parser(); const rssParser = new Parser();