Repository navigation
feat(routing): add opt-in HTTPS redirects - #625
Conversation
🚀 Deploying Preview to Cloudflare 🚀Preview URL: https://fix-http-to-https-redirects-void-cloud.voidzero-docs.workers.dev (commit 99c9f2f)This URL reflects your latest Preview deploymentPreview Deployments by commit
|
|
IMO this should be the default but would be a breaking change 😮💨 |
- Redirect in createWorkerFetch before the ISR cache, so cached pages are never served over HTTP. In-process server fetch and cron jobs call the app directly and no longer get a 308. - Reject alwaysUseHttps with node/bun/deno targets, which never redirect. - Stop native Cloudflare deploys of frameworks that own their Worker when alwaysUseHttps is set; static framework builds still redirect. - Keep the hashed asset Worker bypass so asset requests stay free on Workers Free. - Replace the loopback regex with a small parser. - Document the behaviour in the redirects guide. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@codex review |
06fa762 to
99c9f2f
Compare
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Would this be considered a bug fix? Other than in local development mode, should applications in any deployment state default to HTTPS? |
|
@fengmk2 yes, I would consider this is a bug fix |
|
Does this mean we can move .rs & .cloud sites to https? |
A lot of deployed apps should be https by default. This is not easy to set up via the Void config (only a custom middleware would do the tricks).
This PR adds a
routing.alwaysUseHttpsas a per-app opt-intrueredirects HTTP to HTTPS with a permanent 308, preserving the path, query string, and request method.falsekeeps things aa they are rn.