-
Bug
-
Resolution: Not a bug
-
Minor
-
None
-
4.4.7, 4.5.3
-
MOODLE_404_STABLE, MOODLE_405_STABLE
The LTI Assignment and Grade Services implementation in Moodle incorrectly enforces that GET requests to /LineItems endpoint must use Accept: application/vnd.ims.lis.v2.lineitemcontainer+json, returning a 400 error if application/vnd.ims.lis.v2.lineitem+json is used.
This contradicts the IMS Global LTI AGS specification (http://www.imsglobal.org/spec/lti-ags/v2p0/). In section 3.2.2.1, the specification shows an example of using GET with Accept: application/vnd.ims.lis.v2.lineitem+json.
Current behaviour:
- GET request with Accept: application/vnd.ims.lis.v2.lineitem+json returns 400 error "No context or unsupported content type"
- Only Accept: application/vnd.ims.lis.v2.lineitemcontainer+json is allowed for GET requests
Expected behaviour:
- Both content types should be accepted for GET requests:
- application/vnd.ims.lis.v2.lineitemcontainer+json
- application/vnd.ims.lis.v2.lineitem+json
The issue is in the execute() method of the LineItems endpoint handler, specifically in this condition at line 91
!($container ^ ($response->get_request_method() === self::HTTP_POST))
where $container is false if the Accept header isn't the container format, causing a 400 error for valid requests using the lineitem format.
Possible fixes to the issue:
- 401 branch: https://github.com/weilai-irl/moodle/commit/606576022ab00783fa628ad3a0a88fb1ba7256e3
- 403 branch: https://github.com/weilai-irl/moodle/commit/ad7d88bbacb089a8c21845693c24b5e767e1b962
- 404 branch:https://github.com/weilai-irl/moodle/commit/9b0ae83b9ec1ad4678a9cecfb94bf31a8e6da539
- 405 branch: https://github.com/weilai-irl/moodle/commit/0252672b62e0e532198c99370847cee9be4a46e5
- has been marked as being related by
-
MDL-62599 Add LTI 1.3 support to Moodle
-
- Closed
-