Skip to content

Public resource URLs shouldn't refer to base API URL #496

@barjin

Description

@barjin

Running the following code on Platform:

from apify_client import ApifyClientAsync
import os

async def main() -> None:
    apify_client = ApifyClientAsync(os.environ['APIFY_TOKEN'], api_url=os.environ['APIFY_API_BASE_URL'])

    kvs = apify_client.key_value_store(os.environ['APIFY_DEFAULT_KEY_VALUE_STORE_ID'])
    print(await kvs.create_keys_public_url())

Leads to this:

Image

Platform sets the APIFY_API_BASE_URL to an internal address to simplify communication between the Actors and Apify Platform internals. This shouldn't be used when constructing the public resource URLs (in methods like KVS.create_keys_public_url and similar).

Parity for apify/apify-client-js#744

Metadata

Metadata

Assignees

Labels

t-toolingIssues with this label are in the ownership of the tooling team.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions