Can we try to use `encodeURIComponent(location.href)` here, and then `decodeURIComponent` on the backend?