Skip to content

Commit

Permalink
fix(server): HttpRequestService.sendでは常にUser-Agentを含むように
Browse files Browse the repository at this point in the history
Fix #9817 (maybe)
  • Loading branch information
tamaina committed Feb 14, 2023
1 parent 8d4c5de commit 55d4d34
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/backend/src/core/HttpRequestService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ export class HttpRequestService {
const res = await this.send(url, {
method: 'GET',
headers: Object.assign({
'User-Agent': this.config.userAgent,
Accept: accept,
}, headers ?? {}),
timeout: 5000,
Expand All @@ -114,7 +113,6 @@ export class HttpRequestService {
const res = await this.send(url, {
method: 'GET',
headers: Object.assign({
'User-Agent': this.config.userAgent,
Accept: accept,
}, headers ?? {}),
timeout: 5000,
Expand Down Expand Up @@ -144,7 +142,10 @@ export class HttpRequestService {

const res = await fetch(url, {
method: args.method ?? 'GET',
headers: args.headers,
headers: {
'User-Agent': this.config.userAgent,
...(args.headers ?? {})
},
body: args.body,
size: args.size ?? 10 * 1024 * 1024,
agent: (url) => this.getAgentByUrl(url),
Expand Down

0 comments on commit 55d4d34

Please sign in to comment.