-
Notifications
You must be signed in to change notification settings - Fork 18
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
piwik.js can't be loaded due to the CSP (Content Security Policy) #30
Comments
Hi, hit the same bug. Notice: i host nextcloud / owncloud and piwik on the same domain. first i noticed there is no 'self' in the CSP header so i looked how to fix this issue tried tweaking the piwik\appinfo\app.php :
unfortunately this doesn't has the desired effect (no self in the CSP Header) so i ended up with this tweak:
aka commented the HTTP_HOST header check in app.php maybe someone knows an better solution for this issue :-) regards Alex |
Hey Alex, Regards, Nils |
Mh. I think the cleaner solution would be to improve the host/url check. But anyway I am wondering, why self is missing in the csp header... |
I also encounter this issue on Nextcloud 11, but the effect depends on the browser...with the default code, tracking works on Safari, IE and Edge but fails with Firefox and Chrome. Modifying the code like Alex-Ba suggests "works" but I'm really not skilled enough to track the root cause and fix anything. |
The problem comes from the parse_url
|
@Xqua can you explain that in more detail? What is the value of |
I did this a while back ... I think it was returning a nil or some sort. |
Hope the fix works for you guys. |
I'll try it next week and get back to you ! |
The errors re-appears in Nextcloud 16.
All of your mentioned fixes causes the app to change its state from being enabled to disabled. Cheers, Carsten (https://www.c-rieger.de) |
I gave up on NextCloud, sorry I won't be able to help. |
@criegerde #70 should fix it, please let me know if it doesn't. The addon will be disabled if the app is not marked as compliant (e.g. error in code) |
Hi, sadly chrome refuses to load the piwik.js, because of a violation of the content security policy.
On mobile devices, like my Android Phone, there is no such problem and Piwik is tracking the visits without a problem. Just desktop browsers don't work (as long as i can see).
The text was updated successfully, but these errors were encountered: