Page MenuHomePhabricator

ApiSandbox: HTTP error when using large form fields
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Go to Special:ApiSandbox on a wiki.
  • Select the "parse" module.
  • Enter a few kilobytes of text into a field such as "text".
  • Attempt to send the request.

What happens?:

An error occurred while loading the API query response: HTTP error: .

What should have happened instead?:

The content is parsed and the API result is displayed.

Other information (browser name/version, screenshots, etc.):

This is likely caused by rMWd378200408ae: ApiSandbox: Only use POST and multipart/form-data when necessary which changed ApiSandbox to start using GET rather than POST when a module isn't flagged as specifically requiring POST, without regard for whether the request being made would exceed the length limitation on a GET request.

Event Timeline

HCoplin-WMF subscribed.

Thanks for flagging, @Anomie . It seems like we could add a check for payloads that exceed the max size for a GET, and/or add an option in the UI that allows people to opt in for POST. It also seems like this change could be helpful in modules beyond parse, as well, so it might make sense for MWI to take a look at adding said checks to the framework. Also moving this to our bugs & chores section, as it might be a good item for someone on our call rotation to tackle as time allows.

That being said, I can't guarantee a timeline for when we will be able to take a look at this within MWI, so definitely open to @matmarex taking an initial crack at it if he has time.

Marking as medium priority for now, as I can definitely see how this would be frustrating!

Change #1203259 had a related patch set uploaded (by Ammarpad; author: Ammarpad):

[mediawiki/core@master] ApiSandbox: Use POST when we have long URL

https://gerrit.wikimedia.org/r/1203259

matmarex assigned this task to Ammarpad.
matmarex added a subscriber: Ammarpad.

Thanks @Ammarpad and @Anomie.

Change #1203259 merged by jenkins-bot:

[mediawiki/core@master] ApiSandbox: Use POST when we have long URL

https://gerrit.wikimedia.org/r/1203259

Change #1204688 had a related patch set uploaded (by Reedy; author: Ammarpad):

[mediawiki/core@REL1_45] ApiSandbox: Use POST when we have long URL

https://gerrit.wikimedia.org/r/1204688

Change #1204689 had a related patch set uploaded (by Reedy; author: Ammarpad):

[mediawiki/core@REL1_44] ApiSandbox: Use POST when we have long URL

https://gerrit.wikimedia.org/r/1204689

Change #1204690 had a related patch set uploaded (by Reedy; author: Ammarpad):

[mediawiki/core@REL1_43] ApiSandbox: Use POST when we have long URL

https://gerrit.wikimedia.org/r/1204690

Change #1204688 merged by jenkins-bot:

[mediawiki/core@REL1_45] ApiSandbox: Use POST when we have long URL

https://gerrit.wikimedia.org/r/1204688

Change #1204689 merged by jenkins-bot:

[mediawiki/core@REL1_44] ApiSandbox: Use POST when we have long URL

https://gerrit.wikimedia.org/r/1204689

Change #1204690 merged by jenkins-bot:

[mediawiki/core@REL1_43] ApiSandbox: Use POST when we have long URL

https://gerrit.wikimedia.org/r/1204690