milesmcc / shynet

Modern, privacy-friendly, and detailed web analytics that works without cookies or JS.
Apache License 2.0
2.93k stars 191 forks source link

Error 403 when trying to load the script #335

Open patrickuhlmann opened 1 week ago

patrickuhlmann commented 1 week ago

When I copy the code exactly as it is displayed it does not work on all pages. Sometimes an error 403 is encountered when trying to load the script. A precondition to encounter the behavior is that "Allowed origins" is set.

From my observation the reason is that in the GET request does not include an Origin Header which is needed if the option "allowed origins" is set. To fix the behavior the following attribute must included referrerpolicy="origin"

It might be a good idea to add it to the displayed code for embedding the statistics (at least if "allowed origins" is set).