Skip to content

Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.

Fix URL encoding in devices report

Uku Taht8e9c938a9e6d
diff --git a/assets/js/dashboard/stats/devices.js b/assets/js/dashboard/stats/devices.js
index 14c347a7ee..f8dfffaa06 100644
--- a/assets/js/dashboard/stats/devices.js
+++ b/assets/js/dashboard/stats/devices.js
@@ -56,7 +56,7 @@ class ScreenSizes extends React.Component {
}
fetchScreenSizes() {
- api.get(`/api/stats/${this.props.site.domain}/screen-sizes`, this.props.query)
+ api.get(`/api/stats/${encodeURIComponent(this.props.site.domain)}/screen-sizes`, this.props.query)
.then((res) => this.setState({loading: false, sizes: res}))
}
@@ -118,7 +118,7 @@ class Browsers extends React.Component {
}
fetchBrowsers() {
- api.get(`/api/stats/${this.props.site.domain}/browsers`, this.props.query)
+ api.get(`/api/stats/${encodeURIComponent(this.props.site.domain)}/browsers`, this.props.query)
.then((res) => this.setState({loading: false, browsers: res}))
}
@@ -180,7 +180,7 @@ class OperatingSystems extends React.Component {
}
fetchOperatingSystems() {
- api.get(`/api/stats/${this.props.site.domain}/operating-systems`, this.props.query)
+ api.get(`/api/stats/${encodeURIComponent(this.props.site.domain)}/operating-systems`, this.props.query)
.then((res) => this.setState({loading: false, operatingSystems: res}))
}