Skip to content

Commit 4fd8405

Browse files
committed
redirect experiments/next to staging
1 parent f8c8961 commit 4fd8405

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/server.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,12 @@ app.use((req, res, next) => {
168168
return;
169169
}
170170

171+
if (branchName === 'next') {
172+
const search = url.parse(req.url).search;
173+
res.redirect(`https://staging.turbowarp.org${branchRelativePath}${search || ''}`);
174+
return;
175+
}
176+
171177
req.branchPrefix = prefix;
172178
req.branchRelativePath = branchRelativePath;
173179
} else {

test/transitional-redirects.test.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,10 @@ it('merge-upstream: redirects', async () => {
7777
.expect(302);
7878
expect(req.headers['location']).toBe('https://turbowarp.org/editor?fps=60');
7979
});
80+
81+
it('next: redirects', async () => {
82+
const req = await request.get('/next/editor?fps=60')
83+
.set('Host', 'notlocalhost')
84+
.expect(302);
85+
expect(req.headers['location']).toBe('https://staging.turbowarp.org/editor?fps=60');
86+
});

0 commit comments

Comments
 (0)