Review TYPO3_4-5 Merged

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

Christian Kuhn CR +2 V +2 Easy +26 −6 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
  • Verified V +2
    • Christian Kuhn +2

Files 2

Review log 3

  1. Christian Kuhn commented on patch set 1 V 0 07/20/12, 10:25

    by team member; Looks good to me, approved
  2. Christian Kuhn merged patch set 1 07/20/12, 10:25

  3. Ernesto Baschny commented on patch set 1 07/20/12, 10:25

    (1 inline comment) Adding a new API method might be dangerous in released TYPO3 versions, because extensions might start using them, thus requiring certain "minor TYPO3" versions. While in overall there is no problem with this, we haven't usually done that before.

    class.t3lib_utility_http.php:106

    Sorry, but only asking now. But why is "303" the default and not something more commonly used like "404" or "500"?