Skip to content
Snippets Groups Projects
Commit 55d4d341 authored by tamaina's avatar tamaina
Browse files

fix(server): HttpRequestService.sendでは常にUser-Agentを含むように

Fix #9817 (maybe)
parent 8d4c5deb
No related branches found
No related tags found
No related merge requests found
......@@ -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,
......@@ -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,
......@@ -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),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment