Review main Merged

12867[BUGFIX] Send sane HTTP response in showpic on error

Christian Kuhn CR +2 V +2 Easy +25 −5 updated 06/03/13, 20:49

Commit message

Currently, if showpic.php requests fail, exceptions are thrown. Those are
usually converted to a HTTP response 500 (internal server error) by the
production exception handler. Crawlers react on 500 by trying to index
the resource again later.

This is changed to now set specific response codes. If the paramters are
incorrect or broken, an 410 (Gone) will be sent, informing users and
crawlers that the resource is not available under this URL. Crawlers
like googleBot will then stop requesting the resource.

In case all parameters are ok, but the image itself is not found, a 404
will be sent to the client. Crawlers will try to index the resource
again only if there are still links pointing to the resource.

Review

  • Code review CR +2
    • Christian Kuhn +2
    • Mario Rimann +1
    • Anja Leichsenring +1
    • Marcus Krause +1
    • Ernesto Baschny +1
  • Verified V +2
    • Christian Kuhn +2
    • Anja Leichsenring +1
    • Marcus Krause +1

Files 2

Review log 10

  1. Ernesto Baschny commented on patch set 1 07/20/12, 09:56

    Looks good to me, but someone else must approve
  2. Mario Rimann commented on patch set 1 07/20/12, 09:56

    Looks good to me, but someone else must approve I guess that the whole header-throwing stuff is not tested/testable with reasonable efforts, right? If not, it would be cool to add tests for the stuff in class.t3lib_utility_http.php
  3. Christian Kuhn commented on patch set 1 07/20/12, 09:56

    We actually tried to add a test for the setResponseCode method, but were unable to find a working solution with ob_start, headers_list and so on. Especially headers_list() doesn't seem to always give back useful results and it seems to depend on the SAPI and maybe other things. We dropped the test after nearly an hour of fiddling again.
  4. Marcus Krause commented on patch set 1 07/20/12, 09:56

    Verified; Looks good to me, but someone else must approve patch is running on a live server; no more flodding of the BE log and crawlers who respect the HTTP codes; +1 for core integration
  5. Anja Leichsenring voted on patch set 1 V 0 07/20/12, 09:56

  6. Anja Leichsenring commented on patch set 1 07/20/12, 09:56

    Looks good to me, but someone else must approve
  7. Mr. Jenkins commented on patch set 1 07/20/12, 09:56

  8. Christian Kuhn commented on patch set 1 V 0 07/20/12, 09:56

    by team member; Looks good to me, approved
  9. Christian Kuhn merged patch set 1 07/20/12, 09:56