Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#39530 closed defect (bug) (worksforme)

When posting too many comments via API, the error response is HTML, not JSON

Reported by: martinmalinda Owned by: joehoyle
Milestone: Priority: normal
Severity: normal Version: 4.7
Component: REST API Keywords: reporter-feedback
Focuses: Cc:

Description (last modified by SergeyBiryukov)

Basically it sends this HTML response:

<body id="error-page">
	<p>You are posting comments too quickly. Slow down.</p></body>

Change History (5)

#1 @rmccue
4 years ago

  • Component changed from General to REST API
  • Focuses rest-api removed

Thought we caught this previously. Basically, the underlying functions that the comment controller calls check for comment floods, then call wp_die.

#2 @SergeyBiryukov
4 years ago

  • Description modified (diff)

#3 @joehoyle
4 years ago

  • Milestone changed from Awaiting Review to 4.8
  • Owner set to joehoyle
  • Status changed from new to assigned

I'll try get a patch.

#4 @joehoyle
4 years ago

  • Keywords reporter-feedback added

I took a look into this and was unable to reproduce. I tested with anonymous users creating comment and verified the response is the expected:

{"code":"comment_flood","message":"You are posting comments too quickly. Slow down.","data":{"status":400}}

@martinmalinda could you attached the request details for the exact request you are making?

#5 @rmccue
4 years ago

  • Milestone 4.8 deleted
  • Resolution set to worksforme
  • Status changed from assigned to closed

Two weeks without reporter feedback, so closing this one out.

@martinmalinda If you can reproduce this on the latest version of trunk, please feel free to reopen!

Note: See TracTickets for help on using tickets.