@@ -27,10 +27,10 @@ const defaultValues = {
2727}
2828
2929export class DefaultDelegatedRoutingV1HttpApiClient implements DelegatedRoutingV1HttpApiClient {
30+ public endpoint : URL
3031 private started : boolean
3132 private readonly httpQueue : PQueue
3233 private readonly shutDownController : AbortController
33- private readonly clientUrl : URL
3434 private readonly timeout : number
3535 private readonly contentRouting : ContentRouting
3636 private readonly peerRouting : PeerRouting
@@ -51,7 +51,7 @@ export class DefaultDelegatedRoutingV1HttpApiClient implements DelegatedRoutingV
5151 concurrency : init . concurrentRequests ?? defaultValues . concurrentRequests
5252 } )
5353 this . inFlightRequests = new Map ( ) // Tracks in-flight requests to avoid duplicate requests
54- this . clientUrl = url instanceof URL ? url : new URL ( url )
54+ this . endpoint = url instanceof URL ? url : new URL ( url )
5555 this . timeout = init . timeout ?? defaultValues . timeout
5656 this . filterAddrs = init . filterAddrs
5757 this . filterProtocols = init . filterProtocols
@@ -118,7 +118,7 @@ export class DefaultDelegatedRoutingV1HttpApiClient implements DelegatedRoutingV
118118 await onStart . promise
119119
120120 // https://specs.ipfs.tech/routing/http-routing-v1/
121- const url = new URL ( `${ this . clientUrl } routing/v1/providers/${ cid } ` )
121+ const url = new URL ( `${ this . endpoint } routing/v1/providers/${ cid } ` )
122122
123123 this . #addFilterParams( url , options . filterAddrs , options . filterProtocols )
124124 const getOptions = { headers : { Accept : 'application/x-ndjson' } , signal }
@@ -197,7 +197,7 @@ export class DefaultDelegatedRoutingV1HttpApiClient implements DelegatedRoutingV
197197 await onStart . promise
198198
199199 // https://specs.ipfs.tech/routing/http-routing-v1/
200- const url = new URL ( `${ this . clientUrl } routing/v1/peers/${ peerId . toCID ( ) . toString ( ) } ` )
200+ const url = new URL ( `${ this . endpoint } routing/v1/peers/${ peerId . toCID ( ) . toString ( ) } ` )
201201 this . #addFilterParams( url , options . filterAddrs , options . filterProtocols )
202202
203203 const getOptions = { headers : { Accept : 'application/x-ndjson' } , signal }
@@ -264,7 +264,7 @@ export class DefaultDelegatedRoutingV1HttpApiClient implements DelegatedRoutingV
264264 } )
265265
266266 // https://specs.ipfs.tech/routing/http-routing-v1/
267- const resource = `${ this . clientUrl } routing/v1/ipns/${ libp2pKey } `
267+ const resource = `${ this . endpoint } routing/v1/ipns/${ libp2pKey } `
268268
269269 try {
270270 await onStart . promise
@@ -336,7 +336,7 @@ export class DefaultDelegatedRoutingV1HttpApiClient implements DelegatedRoutingV
336336 } )
337337
338338 // https://specs.ipfs.tech/routing/http-routing-v1/
339- const resource = `${ this . clientUrl } routing/v1/ipns/${ libp2pKey } `
339+ const resource = `${ this . endpoint } routing/v1/ipns/${ libp2pKey } `
340340
341341 try {
342342 await onStart . promise
0 commit comments