neos / redirecthandler

The Neos.RedirectHandler package for Flow
MIT License
4 stars 15 forks source link

410 redirects end up in an exception #14

Open dimaip opened 6 years ago

dimaip commented 6 years ago

410 redirects end up in an uncaught exception. IMO they should be logged (as a INFO or smth), but not just thrown.

Exception in line 66 of /data/releases/current/Data/Temporary/Production/Cache/Code/Flow_Object_Classes/Neos_RedirectHandler_RedirectService.php: 

9 Neos\RedirectHandler\RedirectService_Original::buildResponse(Neos\Flow\Http\Request, Neos\RedirectHandler\Redirect_Original)
8 Neos\RedirectHandler\RedirectService_Original::buildResponseIfApplicable(Neos\Flow\Http\Request)
7 call_user_func_array(array|2|, array|1|)
6 Neos\Flow\ObjectManagement\DependencyInjection\DependencyProxy::__call("buildResponseIfApplicable", array|1|)
5 Neos\RedirectHandler\RedirectComponent_Original::handle(Neos\Flow\Http\Component\ComponentContext)
4 Neos\Flow\Http\Component\ComponentChain_Original::handle(Neos\Flow\Http\Component\ComponentContext)
3 Neos\Flow\Http\Component\ComponentChain_Original::handle(Neos\Flow\Http\Component\ComponentContext)
2 Neos\Flow\Http\RequestHandler::handleRequest()
1 Neos\Flow\Core\Bootstrap::run()

HTTP REQUEST:
GET /a/vecher-pamyati.html?ajax=true HTTP/1.1
Host: psmb.ru
Accept-Encoding: gzip,deflate,br
User-Agent: Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)
From: googlebot(at)googlebot.com
Accept: */*,*/*
Accept-Language: en-US
Referer: https://psmb.ru/a/vecher-pamyati.html?currentPage=2
X-Forwarded-Proto: https
X-Forwarded-For: 66.249.76.63
X-Real-Ip: 66.249.76.63
Connection: close
Content-Length: 
Content-Type: 

HTTP RESPONSE:
[response was empty]

PHP PROCESS:
Inode: 2428116
PID: 24827
UID: 80
GID: 80
User: www-data

    [array] => 
kdambekalns commented 6 years ago

Hm, 410 should behave like 404, in the sense that it should just deliver some response with the correct status…

DrillSergeant commented 6 years ago

We had exactly that "problem" that our exception-folder got flooded by those exceptions. Since Neos 3.3.15 we cannot reproduce it. Maybe this was fixed, but I cannot see anything the the changelog https://github.com/neos/neos-development-collection/compare/3.3.14...3.3.15 about that.

lorenzulrich commented 5 years ago

For Neos 3.2, we added another renderingGroup to solve this problem:

  Flow:
    error:
      exceptionHandler:
         renderingGroups:
           goneExceptions:
             matchingStatusCodes: [410]
             options:
               logException: FALSE
               templatePathAndFilename: 'resource://Foo.Bar/Private/Templates/Error/Default.html'
               variables:
                 errorTitle: 'Entfernt'
                 errorDescription: '<p>Die angeforderte Seite oder Datei <span id="errorUrl"></span> wurde entfernt.</p>'
Sebobo commented 5 years ago

@dimaip is this issue still relevant, or did it solve itself somehow ;) ?