diff --git a/services/web/app/src/Features/Analytics/AnalyticsProxy.js b/services/web/app/src/Features/Analytics/AnalyticsProxy.js index 809d0d0684..366fb0d9a8 100644 --- a/services/web/app/src/Features/Analytics/AnalyticsProxy.js +++ b/services/web/app/src/Features/Analytics/AnalyticsProxy.js @@ -1,7 +1,6 @@ const settings = require('@overleaf/settings') const Errors = require('../Errors/Errors') const httpProxy = require('express-http-proxy') -const { URL } = require('url') module.exports = { call(basePath) { @@ -16,9 +15,9 @@ module.exports = { return httpProxy(settings.apis.analytics.url, { proxyReqPathResolver(req) { - const u = new URL(req.originalUrl, settings.siteUrl) - const requestPath = u.pathname + u.search - return `${basePath}${requestPath}` + // req.url is the part of the path that comes after the mount point in + // app.use() + return `${basePath}${req.url}` }, proxyReqOptDecorator(proxyReqOpts, srcReq) { proxyReqOpts.headers = {} // unset all headers