Skip to content

feat: redirect vp-setup.void.app to setup.viteplus.dev#4

Merged
fengmk2 merged 1 commit intomainfrom
redirect-to-custom-domain
Apr 15, 2026
Merged

feat: redirect vp-setup.void.app to setup.viteplus.dev#4
fengmk2 merged 1 commit intomainfrom
redirect-to-custom-domain

Conversation

@fengmk2
Copy link
Copy Markdown
Member

@fengmk2 fengmk2 commented Apr 15, 2026

Summary

  • Added global Void middleware at middleware/01.redirect-to-custom-domain.ts that issues a 301 redirect from the default vp-setup.void.app host to the canonical custom domain https://setup.viteplus.dev, preserving path and query string
  • Other hosts (custom domain itself, localhost during dev, any preview/staging subdomains) pass through untouched
  • Exported a pure buildRedirectTarget() helper so the logic is unit-testable without spinning up Hono

Test plan

  • vp test — 30 tests pass (6 new in tests/redirect.test.ts)
  • vp check — clean (format, lint, type-check)
  • After merge + deploy:
    • curl -I https://vp-setup.void.app/ returns 301 with Location: https://setup.viteplus.dev/
    • curl -IL 'https://vp-setup.void.app/?tag=v1.2.3&arch=arm64' preserves query and lands on 200
    • curl -I https://setup.viteplus.dev/ returns 200 (no redirect loop)

🤖 Generated with Claude Code

Add global Void middleware that 301-redirects requests on the default
`vp-setup.void.app` host to the canonical custom domain
`setup.viteplus.dev`, preserving path and query. Other hosts (custom
domain, localhost, preview subdomains) pass through untouched.
@fengmk2 fengmk2 self-assigned this Apr 15, 2026
@github-actions
Copy link
Copy Markdown

✅ Staging deployment successful!

Preview: https://vp-setup-staging.void.app/

Comment thread tests/redirect.test.ts
expect(buildRedirectTarget("localhost:5173", "http://localhost:5173/")).toBeNull();
});

it("returns null when host header is missing", () => {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: can the host header ever be null (in a real world scenario)? 👀

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand it doesn't, but hono's API does indeed return undefined https://hono.dev/docs/api/request#header 😢

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean technically this is possible with HTTP1 😂
And then the server should reject.

@fengmk2 fengmk2 merged commit d5052c6 into main Apr 15, 2026
2 checks passed
@fengmk2 fengmk2 deleted the redirect-to-custom-domain branch April 15, 2026 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants