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

fetchTimebounds bug #305

Closed
chukhlov opened this issue May 29, 2019 · 1 comment · Fixed by #487
Closed

fetchTimebounds bug #305

chukhlov opened this issue May 29, 2019 · 1 comment · Fixed by #487
Labels
bug good first issue Hacktoberfest suggested issues for Hacktoberfest

Comments

@chukhlov
Copy link

chukhlov commented May 29, 2019

Describe the bug
fetchTimebounds will return invalid data if current datetime is broken on the local machine.
The problem depends of your axios middleware.
HorizonAxiosClient.interceptors.response.use in the library horizon_axios_client.js

Javascript will convert all object properties in lowercase.
123

property Date of response.headers.Date is undefined!
Please update your module and make is response.headers.date.

Ho to reproduce:

  1. Change your local time -1 hour. Don't change timezone!
  2. await Server.fetchTimebounds(); // invalid property maxTime
@ebma
Copy link

ebma commented Dec 4, 2019

We are currently facing the same issue in our project.

Unfortunately changing the expression in HorizonAxiosClient.interceptors.response.use(...) from response.headers.Date to response.headers.date will not solve the problem, because the date header is not present in the headers object supplied by the axios client.

Screenshot 2019-12-04 at 08 14 47

As pointed out here browsers cannot access the date header by default which probably is the reason why the intercepted response from the axios client does not have a response.headers.date property set.

So I guess the solution would be to make the horizon add a Access-Control-Expose-Headers: date header to responses?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug good first issue Hacktoberfest suggested issues for Hacktoberfest
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants