Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#27248 closed defect (bug) (duplicate)

Use HTTP 4xx instead of 500 for comments posting errors

Reported by: amrmostafa's profile AmrMostafa Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.9
Component: Comments Keywords:
Focuses: Cc:

Description

After you submit an invalid comment (empty comment, invalid email, etc), the displayed error page returns HTTP status code 500 which is to say that there is a server-side issue preventing this request from being successful. I believe a more correct response code would be something in the 4xx space, which says that there is an error in the request as sent by the client.

Practically, why does this matter?

Other than possibly confusing some HTTP middle layers, I think that anyone who is serious about their website will probably be watching the logs for server-side errors calling for their attention. This bug causes a spam-effect in the server error logs, making it difficult to see the actual server-side errors that needs fixing.

Attachments (1)

comments-errors-400.diff (1.7 KB) - added by AmrMostafa 11 years ago.
Use HTTP response code 400 instead of 500 for comment posting errors

Download all attachments as: .zip

Change History (3)

@AmrMostafa
11 years ago

Use HTTP response code 400 instead of 500 for comment posting errors

#1 @mdgl
11 years ago

See also #11286. It's about time we did something to improve this situation!

#2 @SergeyBiryukov
11 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #11286.

Note: See TracTickets for help on using tickets.