Skip to content

AGS results endpoint returns 301 redirect to trailing-slash URL #628

@ayub02

Description

@ayub02

Background

While testing LTI 1.3 Assignment and Grade Services (AGS) with Saltire, the results service failed even though the line item service and score publish service worked.

The issue appears to be that Open edX returns a 301 redirect for the results endpoint:

/api/lti_consumer/v1/lti/6/lti-ags/10/results

redirects to:

/api/lti_consumer/v1/lti/6/lti-ags/10/results/

Saltire appears not to handle this redirect correctly and instead tries to interpret the redirect response as JSON, which leads to the error:

The data (null) must match the type: array

This trailing slash is not present in other AGS calls, and it does not appear to be required by the spec.

Image

Even if some tools follow the redirect, the advertised endpoint should ideally return the expected JSON response directly.

Requiring a redirect on this AGS endpoint could cause interoperability issues with tools that do not follow redirects or do not expect a non-JSON intermediate response.

Observed behavior

A GET request to the results endpoint returns:

HTTP/1.1 301 Moved Permanently
Content-Type: text/html; charset=utf-8
Location: /api/lti_consumer/v1/lti/6/lti-ags/10/results/
Expected behavior

The results endpoint should return the results collection directly, without redirecting to a trailing-slash URL.

Question/ Way forward

Is there a valid reason for this endpoint to redirect?

If not, then Open edX should return the results response directly from the URL /api/lti_consumer/v1/lti/6/lti-ags/10/results.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions