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

Doubt regarding error: TypeError: X-Experience-API-Consistent-Through header was missing or not a number #256

Open
hxs133530 opened this issue Jul 28, 2022 · 1 comment

Comments

@hxs133530
Copy link

hxs133530 commented Jul 28, 2022

Hi,
I am implementing a xAPI LRS and when I run the conformance test, I am getting two failures with error 'TypeError: X-Experience-API-Consistent-Through header was missing or not a number.' I am unable to understand why the error is happening even though for both the POST and the GET requests, the 'X-Experience-API-Consistent-Through' header exists. I have attached screenshots of the log. I would really appreciate any help in solving this error. All the other tests are passing.
error1_21 0
error2_29 2 0

@sfraysse
Copy link

Hi @hxs133530,

I had the same issue and the reason was a duplicate Date header in the LRS responses:

Capture

This may occur in certain circumstances and the LRS Conformance Test Suite does not like it.

In file test/helper.js, line 271, the property res.headers.date returns Thu, 22 Dec 2022 09:58:28 GMT, Thu, 22 Dec 2022 09:58:28 GMT, which is an invalid date.

My workaround: if you can't solve the issue on the server side, replace res.headers.date by res.headersDistinct.date[0]. You need NodeJS v18.3.0+, v16.17.0+ (https://nodejs.org/api/http.html#messageheadersdistinct).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants