Skip to content

Commit

Permalink
fix: preserve query string in web redirects
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinKolarik committed Sep 25, 2024
1 parent f55cf19 commit ed65b15
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/http/middleware/domain-redirect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { Context, Next } from 'koa';
const domainRedirect = () => (ctx: Context, next: Next) => {
if (ctx.host === 'globalping.io') {
ctx.status = 301;
ctx.redirect(`https://jsdelivr.com/globalping${ctx.path !== '/' ? ctx.path : ''}`);
ctx.redirect(`https://jsdelivr.com/globalping${ctx.path !== '/' ? ctx.url : ctx.url.substring(1)}`);
return;
}

Expand Down

0 comments on commit ed65b15

Please sign in to comment.