mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #5547 from overleaf/em-ta-analytics-proxy-fix
Fix how AnalyticsProxy generates the URL GitOrigin-RevId: 272e7ea92d1aa41f7390d39c590336a23dba3708
This commit is contained in:
parent
be809a0de8
commit
fdb5386b85
1 changed files with 3 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue