#41269 closed defect (bug) (fixed)
AJAX hook URL returns 200 when bad/missing action
| Reported by: | ryanrolds | Owned by: | johnbillion |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.9 |
| Component: | Administration | Version: | |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: |
Description
When requesting /wp-admin/admin-ajax.php with an invalid/missing action the response has a status code of 200, which indicates a successful request. A 400 response with a reason would be more fitting.
Attachments (1)
Change History (5)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Hi @ryanrolds. I'm not a core maintainer and I hope one of them will reply to this ticket soon. I also think an appropriate error response code makes sense.
I went ahead and made some changes so that invalid/forged
admin-ajax.phprequests die with a400error code. It will still print0to the screen (for compatibility).Attaching patch. Link to tests: https://travis-ci.org/Ayesh/wordpress-develop/builds/251540542