-
-
Notifications
You must be signed in to change notification settings - Fork 206
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
JSON visitor counter doesn't work because of CORS header #782
Comments
You seem to have run into the same problem I faced yesterday. The URL in the screenshot contains an extra encoded trailing slash, represented by What you want is
I updated the relevant code to remove trailing slash, if any, right before
Specifically, |
Also expose get_data() from count.js, so you can use the same code. Ref: #782
The core problem is that it's a 404: that is, the path isn't known in GoatCounter (in this case, probably due to that slash). It should now also set the CORS header on 404 errors. The URL should be:
Where «PATH» is the exact path as it appears in the dashboard. This should always start with a / (although I think it's added automatically if you omit it). For some people, the path should end with a /. I updated the docs a bit to clarify. I also exposed get_data() from count.js, so you can get the path from there:
|
The text was updated successfully, but these errors were encountered: