[wp-trac] [WordPress Trac] #11333: wp-comments-post shouldn't return a 500 error for user errors
WordPress Trac
wp-trac at lists.automattic.com
Sat Dec 5 04:57:21 UTC 2009
#11333: wp-comments-post shouldn't return a 500 error for user errors
--------------------------+-------------------------------------------------
Reporter: solarissmoke | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Unassigned
Component: Comments | Version:
Severity: normal | Keywords:
--------------------------+-------------------------------------------------
This has been discussed also in
http://core.trac.wordpress.org/ticket/7890, but wasn't addressed, so sorry
to dredge it up again, but I think it is a valid point.
When a user submits a duplicate comment, or enters a comment field
incorrectly, or comments are closed/restricted, wp-comments-post uses
wp_die() to inform them of the error. By default wp_die returns a 500
Internal Sever Error.
However for these cases it isn't a server error, it is a client error. So
the response code should be anything but 500. Maybe 403? Or if that isn't
liked, then just 200. If there isn't agreement on what the response should
be then at least a filter should exist to let the owner choose.
Attached is a proposed change to return a 403 instead of 500.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/11333>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list