Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-84490

LTI AGS GET /LineItems endpoint incorrectly restricts Accept header to lineitemcontainer format

XMLWordPrintable

    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:

          Unassigned Unassigned
          weilai Lai Wei
          Votes:
          2 Vote for this issue
          Watchers:
          4 Start watching this issue

            Created:
            Updated:
            Resolved:

              Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.