Skip to content

mastodon API: block domain is expecting full URL instead of just domain #5645

@technicat

Description

@technicat

from my mastodon/fediverse app, blocking a domain on pixelfed (tested on gram.social and pixelfed.social), e.g. with this request

➡️ 🌏 POST https://gram.social/api/v1/domain_blocks
➡️ 🏷️ Authorization:
➡️ 🏷️ User-Agent: fedicat
➡️ 🏷️ Accept: application/json
➡️ 🏷️ Content-Type: application/json
➡️ 💿 {
"domain" : "pc.cafe"
}

results in an error message saying it expects a full URL

{
  "message" : "The domain is not a valid URL.",
  "errors" : {
    "domain" : [
      "The domain is not a valid URL."
    ]
  }
}

and indeed it works if pass https://pc.cafe/ instead but I'm pretty sure that's incorrect, it should just take the domain (as far as I can tell that's true of all other platforms that support it), and unblock domain on pixelfed actually just takes the domain so I expect this behavior is unintentional

https://docs.joinmastodon.org/methods/domain_blocks/#block

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions