[wp-trac] [WordPress Trac] #43570: preview draft access denied html status code is 500 instead of 401

WordPress Trac noreply at wordpress.org
Sat Mar 17 14:33:29 UTC 2018


#43570: preview draft access denied html status code is 500 instead of 401
--------------------------+-----------------------------
 Reporter:  graymouser    |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  4.9.4
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 When logged out attempting to view an edit post 'preview changes' link
 (i.e. link with ending like
 ?preview_id=7954&preview_nonce=5fd05f823e&post_format=standard&_thumbnail_id=7963&preview=true)
 shows;

 "Sorry, you are not allowed to preview drafts."

 Which is correct, however the HTML status code returned is 500 (internal
 server error), whereas I believe it should actually be 401 (unauthorized).

 Another option would be to have it the same as the edit post link which
 redirects to login page for non-logged in users.

 Easy way to test is to edit a post, click on 'preview changes' then copy
 paste the preview url into a new private browsing window.

 The reason this is relevant is Google Search Console/Webmaster tools
 reports this as an error in site crawls.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/43570>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list