This commit is contained in:
parent
3319f59f17
commit
6c87994d5d
@ -37,7 +37,7 @@ export class NetError extends Error {
|
||||
class NetToolBase {
|
||||
protected prefix: string
|
||||
protected headers: Record<string, string>
|
||||
protected getHeaders: () => Record<string, string>
|
||||
protected getHeaders: () => Promise<Record<string, string>>
|
||||
protected logger: Logger
|
||||
protected requestId: string
|
||||
|
||||
@ -58,12 +58,12 @@ class NetToolBase {
|
||||
}: {
|
||||
prefix?: string
|
||||
headers?: Record<string, string>
|
||||
getHeaders?: () => Record<string, string>
|
||||
getHeaders?: () => Promise<Record<string, string>>
|
||||
requestId?: string
|
||||
} = {}) {
|
||||
this.prefix = prefix || ""
|
||||
this.headers = headers || {}
|
||||
this.getHeaders = getHeaders || (() => ({}))
|
||||
this.getHeaders = getHeaders || (async () => ({}))
|
||||
this.requestId = requestId || ""
|
||||
this.logger = logger.child({ requestId })
|
||||
}
|
||||
@ -86,7 +86,7 @@ class NetToolBase {
|
||||
}: {
|
||||
prefix?: string
|
||||
headers?: Record<string, string>
|
||||
getHeaders?: () => Record<string, string>
|
||||
getHeaders?: () => Promise<Record<string, string>>
|
||||
requestId?: string
|
||||
} = {}) {
|
||||
return new NetToolBase({
|
||||
|
Loading…
x
Reference in New Issue
Block a user