mirror of
https://github.com/simonw/dclient.git
synced 2026-07-27 11:24:33 +02:00
actor command: make URL optional, fix actor URL construction
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
4cb77386c7
commit
1b4dc85974
1 changed files with 2 additions and 4 deletions
|
|
@ -252,7 +252,7 @@ def insert(
|
|||
|
||||
|
||||
@cli.command()
|
||||
@click.argument("url_or_alias")
|
||||
@click.argument("url_or_alias", default=None, required=False)
|
||||
@click.option("--token", help="API token")
|
||||
def actor(url_or_alias, token):
|
||||
"""
|
||||
|
|
@ -270,9 +270,7 @@ def actor(url_or_alias, token):
|
|||
|
||||
token = _resolve_token(token, url)
|
||||
|
||||
url_bits = url.split("/")
|
||||
url_bits[-1] = "-/actor.json"
|
||||
actor_url = "/".join(url_bits)
|
||||
actor_url = url.rstrip("/") + "/-/actor.json"
|
||||
response = httpx.get(
|
||||
actor_url, headers={"Authorization": "Bearer {}".format(token)}, timeout=40.0
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue