65396[TASK] Replace string parsing in Message with unpack
Commit message
Review
-
Code review CR +2 Done
- Christian Kuhn +2
- Oli Bartsch +1
-
Verified V +2 Done
- Christian Kuhn +2
- Oli Bartsch +1
- TYPO3com +1 CI
- core-ci +1 CI
Issues 1
Files 2
Review log 1924
-
Claus Due uploaded patch set 1 08/20/20, 15:57
-
TYPO3com voted on patch set 1 V +1 08/20/20, 16:08 Completed build in 10m 41s on Thu, 20 Aug, 04:08 PM Test Summary: 72996 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-4782
-
Andreas Kienast voted on patch set 1 CR +1 08/21/20, 16:34
-
Jörg Bösche voted on patch set 1 CR +1 02/11/21, 19:19
-
Richard Haeser voted on patch set 1 CR +1 02/12/21, 09:06
-
Guido Schmechel voted on patch set 1 CR +1 02/21/21, 11:47
-
Oliver Hader commented on patch set 1 02/22/21, 09:26
There are no tests for this method, correct? -
Claus Due commented on patch set 1 02/22/21, 09:49
Reply
This should trigger for literally any acceptance test, since it is the base class of both Request and Response. \TYPO3\CMS\Core\Tests\Unit\Http\MessageTest also exists and runs successfully; it does not test the "filter" method explicitly, but it does test the "isValidHeaderValue" method in all tests that construct a Message using ->withHeader and has two methods that explicitly test for the exception that is thrown if "isValidHeaderValue" returns false. I'd say this is pretty well covered ;) -
Oliver Hader commented on patch set 1 02/22/21, 10:44
Reply
Ok, looking into https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/core/Tests/Unit/Http/ResponseTest.php#L208-L224 I'd say it does not cover the parts modified in this patch-set at all ;-) (since the existence of "\r\n" triggered returning `false` already) -
Claus Due commented on patch set 1 02/22/21, 10:52
Reply
The test in ResponseTest is slightly misplaced since it is actually testing the base method on Message, not a method on Response. True, ResponseTest does not cover the changed lines since all the fail-cases are only \r and \n. However, MessageTest *does* cover it since it contains a test case with a \t that isn't covered by the early return by calling strpbrk($value, "\r\n"). -
Claus Due commented on patch set 1 02/22/21, 11:00
Reply
Strike that - this case would actually fail early because it also contains line break and carriage return. I can add a case here that tests specifically for non-LB/CR chars. -
Claus Due uploaded patch set 2 02/22/21, 11:11
-
TYPO3com voted on patch set 2 V -1 02/22/21, 11:17 Completed build in 06m 36s on Mon, 22 Feb, 11:17 AM Test Summary: 1 of 32945 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-9654
-
Claus Due commented on patch set 2 02/22/21, 11:23
Message.php:467This method is kind of weird. First, anything that contains a LF or CR is rejected. But below, both of those characters are allowed by the in_array check. I am pushing a change to avoid this in_array check by and making the condition below only check if $ascii < 32 || $ascii === 9 || $ascii === 127 || $ascii > 254. Sanity check me please: should \t actually be allowed? It appears from this method that it is allowed. -
Claus Due commented on patch set 2 02/22/21, 11:25
Message.php:467Reply Unresolved> $ascii < 32 || $ascii === 9 || $ascii === 127 || $ascii > 254. ($ascii < 32 && $ascii !== 9) || $ascii === 127 || $ascii > 254 of course. -
Claus Due uploaded patch set 3 02/22/21, 11:27
-
TYPO3com voted on patch set 3 V +1 02/22/21, 11:33 Completed build in 06m 36s on Mon, 22 Feb, 11:33 AM Test Summary: 32704 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-9655
-
Christian Kuhn uploaded patch set 4 02/25/21, 16:43
-
Christian Kuhn commented on patch set 4 V +1 CR +1 02/25/21, 16:44
removing v9: this is not critical. -
Oli Bartsch voted on patch set 4 V +1 CR +1 02/25/21, 16:46
-
TYPO3com voted on patch set 4 V +1 02/25/21, 16:52 Completed build in 09m 19s on Thu, 25 Feb, 04:52 PM Test Summary: 32726 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-9728
-
core-ci voted on patch set 4 V +1 02/25/21, 16:53 Core CI is happy: https://core.b13.com/typo3-core/typo3.cms/-/pipelines/1009
-
Christian Kuhn voted on patch set 4 V +2 CR +2 02/25/21, 17:00
-
Christian Kuhn merged patch set 5 02/25/21, 17:01