Skip to content

docs(cloudflare): show how to redirect HTTP to HTTPS on Workers#15926

Open
vamshikrishnaramasamy wants to merge 1 commit into
sveltejs:mainfrom
vamshikrishnaramasamy:docs/issue-15446-cloudflare-https-redirect
Open

docs(cloudflare): show how to redirect HTTP to HTTPS on Workers#15926
vamshikrishnaramasamy wants to merge 1 commit into
sveltejs:mainfrom
vamshikrishnaramasamy:docs/issue-15446-cloudflare-https-redirect

Conversation

@vamshikrishnaramasamy
Copy link
Copy Markdown

Closes #15446.

Cloudflare Workers, unlike Pages, serves HTTP requests as-is rather than redirecting to HTTPS, and Cloudflare's redirect rules aren't available until you onboard a domain. That leaves a SvelteKit app on Workers reachable over plain HTTP with nothing in the docs about it.

Added a short subsection under Cloudflare Workers with a handle hook that redirects GET requests to HTTPS and returns 426 for other methods. Based on the snippet in the issue, completed into a working hook (import of dev, resolve(event) fall-through).

Docs-only, so no changeset.

Cloudflare Workers, unlike Pages, serves HTTP requests without redirecting
to HTTPS, and redirect rules require an onboarded domain. Add a handle hook
example that forces HTTPS for GET requests and returns 426 otherwise.

Closes sveltejs#15446
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 29, 2026

⚠️ No Changeset found

Latest commit: 5866419

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

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.

docs: Cloudflare Workers allows HTTP requests

1 participant