File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ export interface ConfigurationOptions extends CoreConfigurationOptions {
16
16
actorRunId ?: string ;
17
17
actorTaskId ?: string ;
18
18
apiBaseUrl ?: string ;
19
+ apiPublicBaseUrl ?: string ;
19
20
containerPort ?: number ;
20
21
containerUrl ?: string ;
21
22
proxyHostname ?: string ;
@@ -139,6 +140,7 @@ export class Configuration extends CoreConfiguration {
139
140
APIFY_ACTOR_EVENTS_WS_URL : 'actorEventsWsUrl' ,
140
141
APIFY_ACTOR_ID : 'actorId' ,
141
142
APIFY_API_BASE_URL : 'apiBaseUrl' ,
143
+ APIFY_API_PUBLIC_BASE_URL : 'apiPublicBaseUrl' ,
142
144
APIFY_IS_AT_HOME : 'isAtHome' ,
143
145
APIFY_ACTOR_RUN_ID : 'actorRunId' ,
144
146
APIFY_ACTOR_TASK_ID : 'actorTaskId' ,
@@ -183,6 +185,7 @@ export class Configuration extends CoreConfiguration {
183
185
defaultRequestQueueId : LOCAL_ACTOR_ENV_VARS [ ACTOR_ENV_VARS . DEFAULT_REQUEST_QUEUE_ID ] ,
184
186
inputKey : 'INPUT' ,
185
187
apiBaseUrl : 'https://api.apify.com' ,
188
+ apiPublicBaseUrl : 'https://api.apify.com' ,
186
189
proxyStatusUrl : 'http://proxy.apify.com' ,
187
190
proxyHostname : LOCAL_APIFY_ENV_VARS [ APIFY_ENV_VARS . PROXY_HOSTNAME ] ,
188
191
proxyPort : + LOCAL_APIFY_ENV_VARS [ APIFY_ENV_VARS . PROXY_PORT ] ,
Original file line number Diff line number Diff line change @@ -16,11 +16,12 @@ export class KeyValueStore extends CoreKeyValueStore {
16
16
* access the value in the remote key-value store.
17
17
*/
18
18
override getPublicUrl ( key : string ) : string {
19
- if ( ! ( this . config as Configuration ) . get ( 'isAtHome' ) && getPublicUrl ) {
19
+ const config = this . config as Configuration ;
20
+ if ( ! config . get ( 'isAtHome' ) && getPublicUrl ) {
20
21
return getPublicUrl . call ( this , key ) ;
21
22
}
22
23
23
- const publicUrl = new URL ( `https://api.apify.com/v2/key-value-stores/${ this . id } /records/${ key } ` ) ;
24
+ const publicUrl = new URL ( `${ config . get ( 'apiPublicBaseUrl' , ' https://api.apify.com' ) } /v2/key-value-stores/${ this . id } /records/${ key } ` ) ;
24
25
25
26
if ( this . storageObject ?. urlSigningSecretKey ) {
26
27
publicUrl . searchParams . append ( 'signature' , createHmacSignature ( this . storageObject . urlSigningSecretKey as string , key ) ) ;
You can’t perform that action at this time.
0 commit comments