diff --git a/src/server.js b/src/server.js index f86dd9c..86f8ee6 100644 --- a/src/server.js +++ b/src/server.js @@ -164,6 +164,12 @@ app.use((req, res, next) => { return; } + if (branchName === 'merge-upstream') { + const search = url.parse(req.url).search; + res.redirect(`https://staging.turbowarp.org${branchRelativePath}${search || ''}`); + return; + } + req.branchPrefix = prefix; req.branchRelativePath = branchRelativePath; } else { diff --git a/test/transitional-redirects.test.js b/test/transitional-redirects.test.js index 22caa28..b15a73a 100644 --- a/test/transitional-redirects.test.js +++ b/test/transitional-redirects.test.js @@ -70,3 +70,10 @@ it('return: redirects', async () => { .expect(302); expect(req.headers['location']).toBe('https://turbowarp.org/editor?fps=60'); }); + +it('merge-upstream: redirects', async () => { + const req = await request.get('/merge-upstream/editor?fps=60') + .set('Host', 'notlocalhost') + .expect(302); + expect(req.headers['location']).toBe('https://staging.turbowarp.org/editor?fps=60'); +});