Compare commits

..

1 Commits

Author SHA1 Message Date
甘瀬ここあ 8518a5271b
Merge c488ba03b7 into 752606fe88 2024-11-21 17:24:18 +09:00
2 changed files with 3 additions and 4 deletions

View File

@ -283,7 +283,6 @@ 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(() => {
@ -292,7 +291,7 @@ export class HttpRequestService {
const isLocalAddressAllowed = args.isLocalAddressAllowed ?? false; const isLocalAddressAllowed = args.isLocalAddressAllowed ?? false;
const res = await fetch(decodedUrl, { const res = await fetch(url, {
method: args.method ?? 'GET', method: args.method ?? 'GET',
headers: { headers: {
'User-Agent': this.config.userAgent, 'User-Agent': this.config.userAgent,
@ -300,7 +299,7 @@ export class HttpRequestService {
}, },
body: args.body, body: args.body,
size: args.size ?? 10 * 1024 * 1024, size: args.size ?? 10 * 1024 * 1024,
agent: (decodedUrl) => this.getAgentByUrl(decodedUrl, false, isLocalAddressAllowed), agent: (url) => this.getAgentByUrl(url, 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(ps.url, { const res = await this.httpRequestService.send(decodeURIComponent(ps.url), {
method: 'GET', method: 'GET',
headers: { headers: {
Accept: 'application/rss+xml, */*', Accept: 'application/rss+xml, */*',