-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Open
Labels
Component: HTTPIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is not validGate 1 Failed. Automatic verification of issue format is failedGate 1 Failed. Automatic verification of issue format is failedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentGate 4. Acknowledged. Issue is added to backlog and ready for developmentPriority: P3May be fixed according to the position in the backlog.May be fixed according to the position in the backlog.Progress: ready for devReproduced on 2.3.xThe issue has been reproduced on latest 2.3 releaseThe issue has been reproduced on latest 2.3 releaseSeverity: S3Affects non-critical data or functionality and does not force users to employ a workaround.Affects non-critical data or functionality and does not force users to employ a workaround.
Milestone
Description
Summary
The validation based on the new (2.3.0+) HTTP method marker interfaces (HttpGetActionInterface, HttpPostActionInterface, ...) throw an exception that is turned into a 404 response by the front controller:
throw new InvalidRequestException(
new NotFoundException(new Phrase('Page not found.'))
);
A proper response status code would be 405 Method Not Allowed
.
Steps to reproduce
- Make a GET request to an action with
HttpPostActionInterface
- Watch the status code received.
Expected Result
- 404 Not Found.
Actual Result
- 405 Method Not Allowed.
Proposed solution
- Use a different "replace result" than
NotFoundException
that at least returns an error page with the correct status code. Minimum solution: send correct status code - Do not mis-use exceptions as results at all Architectural improvement: do not mix unrelated types
- Add more marker interfaces to determine the type of result, i.e.
JsonActionInterface
,HtmlActionInterface
, ... and return a different body depending on those Ideal solution: enable handling of 405 errors in different context
Metadata
Metadata
Assignees
Labels
Component: HTTPIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is not validGate 1 Failed. Automatic verification of issue format is failedGate 1 Failed. Automatic verification of issue format is failedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentGate 4. Acknowledged. Issue is added to backlog and ready for developmentPriority: P3May be fixed according to the position in the backlog.May be fixed according to the position in the backlog.Progress: ready for devReproduced on 2.3.xThe issue has been reproduced on latest 2.3 releaseThe issue has been reproduced on latest 2.3 releaseSeverity: S3Affects non-critical data or functionality and does not force users to employ a workaround.Affects non-critical data or functionality and does not force users to employ a workaround.