Skip to content

Commit

Permalink
fix(backend): HttpRequestService.sendでURLをデコードしてからリクエストを送信するように
Browse files Browse the repository at this point in the history
HttpRequestService側で処理するように変更しました。意図していたものとは異なる可能性もありますが...
  • Loading branch information
AmaseCocoa committed Nov 21, 2024
1 parent c488ba0 commit e9ee83f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/backend/src/core/HttpRequestService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ export class HttpRequestService {
},
): Promise<Response> {
const timeout = args.timeout ?? 5000;
const decodedUrl = decodeURIComponent(url);

const controller = new AbortController();
setTimeout(() => {
Expand All @@ -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,
});

Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/server/api/endpoints/fetch-rss.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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, */*',
Expand Down

0 comments on commit e9ee83f

Please sign in to comment.