Review main Merged

59815[TASK] Add clarification and tests to SiteBasedRedirectResolver

Hendrik Helmken CR +2 V +2 Normal +92 −0 updated 11/09/19, 15:28

Commit message

The original issue for endless redirect loops is already fixed via
https://forge.typo3.org/issues/88032
whereas the query does not result in 307's anymore.

Additional information on redirects is added as comment.

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Susi Moog +1
  • Verified V +2 Done
    • Benni Mack +2
    • Susi Moog +1
    • TYPO3com +1 CI

Issues 1

Files 2

Review log 3957

Show 2032 earlier messages
  1. Hendrik Helmken uploaded patch set 1 02/28/19, 11:37

  2. TYPO3com voted on patch set 1 V -1 02/28/19, 11:37 Completed build in 20s on Thu, 28 Feb, 12:37 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-32416

  3. Hendrik Helmken uploaded patch set 2 02/28/19, 11:48

  4. TYPO3com voted on patch set 2 V -1 02/28/19, 11:48 Completed build in 10s on Thu, 28 Feb, 12:48 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-32417

  5. Hendrik Helmken uploaded patch set 3 02/28/19, 12:05

  6. TYPO3com voted on patch set 3 V -1 02/28/19, 12:05 Completed build in 12s on Thu, 28 Feb, 01:05 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-32418

  7. Hendrik Helmken uploaded patch set 4 02/28/19, 12:08

  8. TYPO3com voted on patch set 4 V +1 02/28/19, 12:21 Completed build in 13m 02s on Thu, 28 Feb, 01:21 PM Test Summary: 46581 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-32419

  9. Benni Mack commented on patch set 4 02/28/19, 20:38

    SiteBaseRedirectResolver.php:69 Unresolved

    1. we can put the out if() in the if () block below. 2. we should rather check against the normalizedParams Object, as TYPo3 could also be located underneath a subfolder like /preview/index.php - and then this check would not work.
  10. Hendrik Helmken uploaded patch set 5 03/01/19, 07:46

  11. TYPO3com voted on patch set 5 V -1 03/01/19, 07:59 Completed build in 13m 33s on Fri, 1 Mar, 08:59 AM Test Summary: 8 of 46918 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-32436

  12. Hendrik Helmken uploaded patch set 6 03/01/19, 08:23

  13. TYPO3com voted on patch set 6 V +1 03/01/19, 08:36 Completed build in 13m 20s on Fri, 1 Mar, 09:36 AM Test Summary: 46581 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-32437

  14. Sebastian Rosskopf voted on patch set 6 V +1 CR +1 03/01/19, 14:47

  15. André Buchmann commented on patch set 6 V -1 03/01/19, 16:55

    This fix does only catch a specific case. With the patch http://typo3-cms.ddev.local/index.php?id=1&L=1 resolves correctly to: http://typo3-cms.ddev.local/de/?id=1&L=1 But http://typo3-cms.ddev.local/de/?id=1&L=0 throws to many redirects error: http://typo3-cms.ddev.local/de////////////////////?id=1&L=0 Tested on master with introduction package with L: 0=en, 1=de
  16. André Buchmann commented on patch set 6 03/01/19, 16:59

    > Patch Set 6: Verified-1 > > This fix does only catch a specific case. > > With the patch http://typo3-cms.ddev.local/index.php?id=1&L=1 resolves correctly to: > http://typo3-cms.ddev.local/de/?id=1&L=1 > > But http://typo3-cms.ddev.local/de/?id=1&L=0 throws to many redirects error: > http://typo3-cms.ddev.local/de////////////////////?id=1&L=0 > > Tested on master with introduction package with L: 0=en, 1=de Also http://typo3-cms.ddev.local/?id=1&L=1 throws to many redirects error
  17. Andreas Kienast uploaded patch set 7 03/04/19, 09:40

  18. TYPO3com voted on patch set 7 V +1 03/04/19, 09:53 Completed build in 13m 39s on Mon, 4 Mar, 10:53 AM Test Summary: 46641 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-32498

  19. Andreas Kienast commented on patch set 7 CR -1 03/04/19, 09:57

    Will try to add tests
  20. Andreas Kienast uploaded patch set 8 03/04/19, 11:04

  21. TYPO3com voted on patch set 8 V +1 03/04/19, 11:21 Completed build in 14m 44s on Mon, 4 Mar, 12:21 PM Test Summary: 46661 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-32503

  22. Andreas Kienast uploaded patch set 9 03/04/19, 14:01

  23. TYPO3com voted on patch set 9 V +1 03/04/19, 14:21 Completed build in 14m 48s on Mon, 4 Mar, 03:21 PM Test Summary: 46681 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-32510

  24. André Buchmann uploaded patch set 10 03/04/19, 15:17

  25. TYPO3com voted on patch set 10 V -1 03/04/19, 15:32 Completed build in 14m 51s on Mon, 4 Mar, 04:32 PM Test Summary: 1660 of 47098 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-32511

  26. André Buchmann uploaded patch set 11 03/04/19, 16:05

  27. TYPO3com voted on patch set 11 V +1 03/04/19, 16:16 Completed build in 10m 28s on Mon, 4 Mar, 05:16 PM Test Summary: 46880 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-32513

  28. Frank Nägler commented on patch set 11 CR -1 03/04/19, 16:59

    SiteBaseRedirectResolver.php:94

    I think is an unsafe condition strpos($requestedUri->getQuery(), 'L=') > 0 this condition match true for &L=1 or ?L=2 but also for &XXXXXL=foo
  29. André Buchmann uploaded patch set 12 03/07/19, 21:20

  30. André Buchmann commented on patch set 12 03/07/19, 21:23

    SiteBaseRedirectResolver.php:94 Reply

    You're right, I've fix it. https://regex101.com/r/InE0Z9/1
  31. TYPO3com voted on patch set 12 V +1 03/07/19, 21:49 Completed build in 15m 27s on Thu, 7 Mar, 10:49 PM Test Summary: 47265 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-32593

  32. Sebastian Rosskopf voted on patch set 12 V +1 CR +1 04/05/19, 09:48

  1. Raphael Thanner voted on patch set 12 V +1 CR +1 04/05/19, 11:06

  2. Hendrik Helmken voted on patch set 12 V +1 CR +1 04/05/19, 11:33

  3. Benni Mack commented on patch set 12 CR -1 04/05/19, 11:42

    SiteBaseRedirectResolver.php:94

    uuuh, preg_match to see if we have a "L" parameter? how about we use "$requestedUri->getQueryParams()['L'] ?? false"

    SiteBaseRedirectResolver.php:133

    http_build_query needs a "PHP_QUERY_RFC3986" as fourth parameter, on top, we need to make sure that nested query arguments work as well then. so I suggest we add tests for this.
  4. Andreas Kienast uploaded patch set 13 04/05/19, 12:24

  5. TYPO3com voted on patch set 13 V -1 04/05/19, 12:24 Completed build in 12s on Fri, 5 Apr, 02:24 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-33065

  6. Andreas Kienast uploaded patch set 14 04/05/19, 12:26

  7. TYPO3com voted on patch set 14 V +1 04/05/19, 12:44 Completed build in 17m 17s on Fri, 5 Apr, 02:44 PM Test Summary: 47325 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-33066

  8. André Buchmann uploaded patch set 15 04/06/19, 09:51

  9. TYPO3com voted on patch set 15 V -1 04/06/19, 10:02 Completed build in 10m 07s on Sat, 6 Apr, 12:02 PM Test Summary: 16 of 47812 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-33098

  10. Riccardo De Contardi commented on patch set 15 V +1 04/06/19, 10:02

    seems to work on Master
  11. André Buchmann commented on patch set 15 04/06/19, 10:04

    I added tests with nested arguments. There are 4 failing test. I don't know if those are false positives because this behavior is intended or if the SiteBaseResolver should keep the arguments?

    SiteBaseRedirectResolver.php:94 Reply

    Done

    SiteBaseRedirectResolver.php:133 Reply

    Done

    SiteBaseRedirectResolverTest.php:248 Unresolved

    Test fails: Is it intended to remove arguments on language redirect?

    SiteBaseRedirectResolverTest.php:365 Unresolved

    Test fails: Is it intended to remove arguments on base redirect?

    SiteBaseRedirectResolverTest.php:372 Unresolved

    Test fails: Is it intended to remove arguments on language redirect?

    SiteBaseRedirectResolverTest.php:379 Unresolved

    Test fails: Is it intended to remove arguments on language redirect?
  12. Benni Mack commented on patch set 15 04/15/19, 03:45

    After looking more closely into this issue, I suggest we remove the second redirect "Request was "/fr-FR" but the site is actually called "/fr-FR/" completely
  13. Benni Mack commented on patch set 15 04/29/19, 13:54

    As we've merge the other patch some weeks ago, can you let me know if we still need this patch? otherwise I suggest we'll abandon this one.
  14. André Buchmann commented on patch set 15 04/29/19, 14:57

    > Patch Set 15: > > As we've merge the other patch some weeks ago, can you let me know if we still need this patch? otherwise I suggest we'll abandon this one. The other patch indeed resolved the redirect issue. But I miss some tests there how you expect TYPO3 to behave. Even one test got deleted where I would expect that the trailing slash of the base should be respected. Maybe some tests of this patch could help to proof the wanted behaviour. e.g.: Is it cool to get a completely different page and language if I add "?id=14&L=0" to a subpage url like this: http://typo3-cms.ddev.local/da/content-examples/special-elements/html/?id=14&L=0 Original page id is "13" and the base "da" is L=1 (introductionpackage)
  15. Benni Mack uploaded patch set 16 11/09/19, 13:36

  16. Daniel Goerz uploaded patch set 17 11/09/19, 13:43

  17. TYPO3com voted on patch set 16 V +1 11/09/19, 13:44 Completed build in 08m 18s on Sat, 9 Nov, 01:44 PM Test Summary: 48235 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-38174

  18. TYPO3com voted on patch set 17 V +1 11/09/19, 13:53 Completed build in 09m 53s on Sat, 9 Nov, 01:53 PM Test Summary: 48267 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-38176

  19. Susi Moog voted on patch set 17 CR +1 11/09/19, 14:23

  20. Susi Moog voted on patch set 17 V +1 11/09/19, 14:23

  21. Benni Mack updated the commit message in patch set 18 11/09/19, 14:33

  22. TYPO3com voted on patch set 18 V +1 11/09/19, 14:43 Completed build in 10m 15s on Sat, 9 Nov, 02:43 PM Test Summary: 48265 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-38186

  23. Susi Moog voted on patch set 18 V +1 CR +1 11/09/19, 15:26

  24. Benni Mack voted on patch set 18 V +2 CR +2 11/09/19, 15:28

  25. Benni Mack merged patch set 19 11/09/19, 15:28