Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(xAPI) - ensure the correct lrs_endpoint is used #33

Merged
merged 1 commit into from
Nov 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/out/xapi/xapi.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ export default class XAPI {
headers,
};

const xAPIEndpoint = new URL("xAPI/statements", lrs_endpoint);
// Remove /xapi(/)(statements)(/) from the end of the lrs_endpoint to ensure the correct endpoint is used
const fixed_lrs_endpoint = lrs_endpoint.replace(/\/xapi\/?(statements)?\/?$/i, '');
const xAPIEndpoint = new URL("xAPI/statements", fixed_lrs_endpoint);

try {
const response = await fetch(xAPIEndpoint, requestOptions);
Expand Down