Skip to content

Conversation

@ThisIsMissEm
Copy link
Contributor

@ThisIsMissEm ThisIsMissEm commented Jun 14, 2025

The previous code only supported JSON, but Mastodon being ruby on rails supports params from both JSON and FormData. Fixes #170

We're also going to have similar issues with:

  • PATCH /api/v1/accounts/update_credentials
  • POST /api/v1/accounts/:id/mute
  • POST /api/v1/featured_tags
  • POST /api/v1/lists
  • PUT /api/v1/lists/:id
  • POST /api/v1/lists/:id/accounts
  • DELETE /api/v1/lists/:id/accounts
  • POST /api/v1/markers
  • POST /api/v1/polls/:id/votes
  • POST /api/v1/reports

So we'll need to adjust all of those as well.

@ThisIsMissEm ThisIsMissEm force-pushed the fix/allow-formdata-for-statuses branch from 125cc1b to 5a181de Compare June 14, 2025 18:00
expect(json.application.name).toBe(application.name);
});

it("Can update a status using JSON", async () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tests are a little messy, but that's due to us not having a good way to mock a status object in the database, so instead I'm just creating first, then updating.

scopeRequired(["write:statuses"]),
zValidator(
"json",
app.post("/", tokenRequired, scopeRequired(["write:statuses"]), async (c) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The bulk of the lines changed here are due to whitespace.

@dahlia dahlia added this to the Hollo 0.7 milestone Jun 15, 2025
@dahlia dahlia merged commit d3f1bec into main Jun 15, 2025
2 checks passed
@dahlia dahlia deleted the fix/allow-formdata-for-statuses branch June 15, 2025 01:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incompatibility with the Mastodon.py library?

3 participants