86416[BUGFIX] Return HTTP 400 if request is invalid
Commit message
Review
-
Code review CR +2 Done
- Benni Mack +2
- Benjamin Franzke +1
- Josef Glatz +1
-
Verified V +2 Done
- Benni Mack +2
- Josef Glatz +1
- core-ci +1 CI
Issues 2
Files 5
Review log 4149
Show 2024 earlier messages
-
Markus Klein uploaded patch set 1 10/04/24, 10:22
-
core-ci voted on patch set 1 V +1 10/04/24, 10:38 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/67067
-
Mathias Brodala commented on patch set 1 CR -1 10/04/24, 10:49
-
Andreas Kienast commented on patch set 1 10/04/24, 10:51
AbstractApplication.php:93This code looks very verbose. What's wrong with ```php try { $response = $this->handle(ServerRequestFactory::fromGlobals()); } catch (\InvalidArgumentException) { $response = GeneralUtility::makeInstance(ResponseFactory::class)->createResponse(400); } ``` -
Markus Klein commented on patch set 1 10/04/24, 11:21
AbstractApplication.php:93ReplyI do not want to catch any InvalidArgumentException that may occur within ->handle(). We could add a check for the precise exception code thoughAbstractApplication.php:95ReplyThe whole point is NOT to log this at all. Please take a look at the issue. There is absolutely no point in logging any bullsh** request that is thrown against your server. We are really fed up with this. -
Andreas Kienast commented on patch set 1 10/04/24, 11:24
AbstractApplication.php:93ReplyFair point -
Benjamin Franzke uploaded patch set 2
CR -1V +110/04/24, 11:30 -
Benjamin Franzke commented on patch set 2 10/04/24, 11:30
AbstractApplication.php:93Replyack, but we should terminate within catch anyway. adapted.AbstractApplication.php:95Replyyes, but you want to be able to debug this. A notice is correct IMO. -
core-ci voted on patch set 2 V +1 10/04/24, 11:45 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/67076
-
Mathias Brodala commented on patch set 2 10/04/24, 12:16
AbstractApplication.php:95Reply@markus.klein@typo3.org I know you are fed up but please read my comment again. I understood the issue and what you want to achieve. At the same time I did show a way to have both requirements satisifed: no logging by default with the option to enable it if necessary. -
Mathias Brodala voted on patch set 2 CR +1 10/04/24, 12:18
-
Markus Klein commented on patch set 2 10/04/24, 12:25
AbstractApplication.php:95ReplyNot sure, but we usually do not use log messages to debug things, especially if there is not even a stack trace. (which is the case currently) But, as always, feel free to add/ to improve the patch! (Personally, I do not need any logging at all, not even on Notice level. :-) ) -
Mathias Brodala commented on patch set 3
CR +1V +110/04/24, 12:30Published edit on patch set 2. -
Mathias Brodala commented on patch set 3 CR +1 10/04/24, 12:30
AbstractApplication.php:95ReplyNice catch/notice (heh) about the missing "exception". Added now. -
Mathias Brodala commented on patch set 4
CR +110/04/24, 12:31Published edit on patch set 3. -
Mathias Brodala commented on patch set 4 CR +1 10/04/24, 12:31
Fixed placeholder for exception code. -
Markus Klein commented on patch set 4 10/04/24, 12:32
AbstractApplication.php:95Replythx -
Markus Klein commented on patch set 4 10/04/24, 12:33
AbstractApplication.php:102Not sure if we need both: placeholders and the raw exception -
Mathias Brodala commented on patch set 4 CR 0 10/04/24, 12:36
AbstractApplication.php:102ReplyYeah, likely not that useful. This is actually not really done anywhere else in TYPO3 in case the full exception is provided. Will adjust. -
Mathias Brodala commented on patch set 5 10/04/24, 12:40
Published edit on patch set 4. -
Mathias Brodala commented on patch set 5 10/04/24, 12:41
AbstractApplication.php:102ReplyOpted for keeping at least the message inline for quick lookup/message grouping without having to wade through the exception trace. -
Markus Klein commented on patch set 5 10/04/24, 12:44
AbstractApplication.php:102ReplyAcknowledged -
core-ci voted on patch set 3 V +1 10/04/24, 12:46 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/67082
-
core-ci voted on patch set 4 V +1 10/04/24, 12:50 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/67084
-
Benjamin Franzke commented on patch set 5 10/04/24, 12:54
AbstractApplication.php:95Replywhy do we need the entire stack trace here? code was sufficient IMO… -
core-ci voted on patch set 5 V +1 10/04/24, 12:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/67085
-
Markus Klein commented on patch set 5 10/04/24, 13:14
AbstractApplication.php:95Replymy POV: if we log, log as much context as possible. but really no hard feeling here. -
Mathias Brodala commented on patch set 5 10/04/24, 13:28
AbstractApplication.php:95ReplyI agree, if we have an exception at hand, we should fully log it, just like everywhere in TYPO3. Otherwise the log entry is only half as useful. Once again: this does not affect default logging which starts at WARNING and higher. So "size" should not matter. -
Benjamin Franzke commented on patch set 5 CR +1 V +1 10/04/24, 14:19
AbstractApplication.php:95ReplyI really hate full exceptions in logs instead of the equal information in short form (remember: code in unique in TYPO3 core) – that maekes logs unreadable, but don't care enough right now. -
Mathias Brodala commented on patch set 5 10/04/24, 14:21
AbstractApplication.php:95ReplyActually both make sense. Especially if you use log aggregation solutions which actually parse the exception trace. But that depends on the setup. I'm also fine with any solution, as long as we optionally log at least something. -
Benjamin Franzke updated the commit message in patch set 6
CR +1V +110/07/24, 05:49 -
Benjamin Franzke voted on patch set 6 CR +1 V +1 10/07/24, 05:49
-
core-ci voted on patch set 6 V +1 10/07/24, 06:06 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/67202
-
Oliver Hader updated the commit message in patch set 7
CR +1V +110/18/24, 14:00 -
Oliver Hader rebased onto patch set 8 11/15/24, 09:36
-
core-ci voted on patch set 8 V +1 11/15/24, 09:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/69467
-
Benni Mack voted on patch set 8 CR +1 V +1 11/15/24, 10:00
-
Josef Glatz voted on patch set 8 CR +1 11/17/24, 03:53
-
Josef Glatz commented on patch set 8 V +1 11/17/24, 04:12
I really like this approach! Is there a important rST necessary which could be interested for setups behind reverse proxies? e.g. filtering http error from application on "reverse proxy / load balancer layer"? -
Benjamin Franzke commented on patch set 8 CR -1 11/18/24, 09:07
AbstractApplication.php:102Not a notice, this is debug. Notice is something that *may* need action by the admin. An invalid request is really just debug. -
Markus Klein commented on patch set 9
CR +1V +111/18/24, 10:25Published edit on patch set 8. -
Markus Klein commented on patch set 9 11/18/24, 10:25
AbstractApplication.php:102ReplyGood catch. Thanks. -
Markus Klein commented on patch set 9 11/18/24, 10:26
Reply
Talked to Josef on Slack. Not necessary. -
core-ci voted on patch set 9 V +1 11/18/24, 10:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/69582
-
Benni Mack voted on patch set 9 CR +1 V +1 11/18/24, 13:24
-
Josef Glatz voted on patch set 9 CR +1 V +1 11/18/24, 14:10
-
Benjamin Franzke voted on patch set 9 CR +1 11/22/24, 09:38
-
Benni Mack voted on patch set 9 CR +2 V +2 11/22/24, 09:55
-
Benni Mack merged patch set 10 11/22/24, 09:55
AbstractApplication.php:95